Re: caching question

From: Date: Sat, 19 Jul 2003 14:47:34 +0000
Subject: Re: caching question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-155890@lists.php.net to get a copy of this message
Jean-Christian IMbeault <jc@mega-bucks.co.jp> wrote: > I am using Apache 1.3.27 and PHP 4.3.3.RC1 and someone has told me that > my web page cannot be cached but I cannot figure out why. My friend > tells me my pages all keep sending this in their headers: > > Cache-Control: post-check=0, must-revalidate, no-store, no-cache, > pre-check=0 > > But I can't figure out why the headers are set like this. I am not > setting any headers so I am wondering if it is a setting in my web > server, php.ini file or some other php scripts I have running in the > background. In most cases you dont want your php output to get cached, and so php will do this automaticly. You can stop that from happening by sending the same header with public as the paramater: Cache-Control: public You also might want to set a few others: /* if you are sending a file send the last modified time */ 'Last-Modified: ' . gmdate("D, d M Y H:i:s", $unix_ts . ' GMT') /* for old ie bug and older proxy caches */ 'Pragma: no-cache'); /* if this applies */ 'Expires: '. gmdate("D, d M Y H:i:s", time()-(1200). ' GMT') Curt. --

« previous php.general (#155890) next »