[pLog-svn] r7210 - plog/branches/lifetype-1.2/class/net/http
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Wed May 15 17:38:10 EDT 2013
Author: jondaley
Date: 2013-05-15 17:38:10 -0400 (Wed, 15 May 2013)
New Revision: 7210
Modified:
plog/branches/lifetype-1.2/class/net/http/httpcache.class.php
Log:
cache headers should be sent on 304 responses too
Modified: plog/branches/lifetype-1.2/class/net/http/httpcache.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/net/http/httpcache.class.php 2013-05-15 21:07:54 UTC (rev 7209)
+++ plog/branches/lifetype-1.2/class/net/http/httpcache.class.php 2013-05-15 21:38:10 UTC (rev 7210)
@@ -143,8 +143,19 @@
elseif ($is304&&($nbCond>0))
{//rfc2616-sec10.html#sec10.3.5
header('HTTP/1.0 304 Not Modified');
+ if ($cacheSeconds==0)
+ {
+ $cache='private, must-revalidate, ';
+ }
+ elseif ($cachePrivacy==0) $cache='private, ';
+ elseif ($cachePrivacy==2) $cache='public, ';
+ else $cache='';
+ $cache.='max-age='.floor($cacheSeconds);
+ header('Cache-Control: '.$cache); //rfc2616-sec14.html#sec14.9
+ header('Last-Modified: '.$dateLastModif);
header('Etag: '.$etagServer);
- if ($feedMode) header('Connection: close'); //Comment this line under IIS
+ if ($feedMode) header('Connection: close'); //rfc2616-sec14.html#sec14.10 //Comment this line under IIS
+
return true;
}
else
@@ -155,7 +166,6 @@
if ($cacheSeconds==0)
{
$cache='private, must-revalidate, ';
- //$cacheSeconds=-1500000; //HTTP/1.0
}
elseif ($cachePrivacy==0) $cache='private, ';
elseif ($cachePrivacy==2) $cache='public, ';
More information about the pLog-svn
mailing list