[pLog-svn] r2320 - plog/branches/plog-1.0.2/class/net/http

jondaley at devel.plogworld.net jondaley at devel.plogworld.net
Thu Jul 14 07:29:20 GMT 2005


Author: jondaley
Date: 2005-07-14 07:29:20 +0000 (Thu, 14 Jul 2005)
New Revision: 2320

Modified:
   plog/branches/plog-1.0.2/class/net/http/httpcache.class.php
Log:
this helps firefox cache more often.  Without this patch, firefox will always alternate between 304 and 200.

Modified: plog/branches/plog-1.0.2/class/net/http/httpcache.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/net/http/httpcache.class.php	2005-07-14 06:59:50 UTC (rev 2319)
+++ plog/branches/plog-1.0.2/class/net/http/httpcache.class.php	2005-07-14 07:29:20 UTC (rev 2320)
@@ -146,6 +146,12 @@
         {//rfc2616-sec10.html#sec10.3.5
             header('HTTP/1.0 304 Not Modified');
             header('Etag: '.$etagServer);
+            if ($cachePrivacy==0) $cache='private, ';
+            elseif ($cachePrivacy==2) $cache='public, ';
+            else $cache='';
+            $cache.='max-age='.floor($cacheSeconds);
+            header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T',time()+$cacheSeconds)); //HTTP/1.0 //rfc2616-sec14.html#sec14.21a
+            header('Cache-Control: '.$cache); //rfc2616-sec14.html#sec14.9
             if ($feedMode) header('Connection: close'); //Comment this line under IIS
             return true;
         }




More information about the pLog-svn mailing list