Re: Making a PHP Script "Very" Cache Friendly

From: Date: Mon, 02 Jun 2003 06:54:42 +0000
Subject: Re: Making a PHP Script "Very" Cache Friendly
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-149760@lists.php.net to get a copy of this message
You can always store the file and every so often regenerate it, and if the regernation hasn't timed out jsut passtrhu the cache. On June 2, 2003 02:38 am, Gerard Samuel wrote: > Searching through the archives, most people are running away from > caching php scripts. > Im trying to do the opposite. > I have a script that fetches css files. Im trying to add header() calls > to it so > that browsers can cache it like a normal css file. > This is what I have at the top of the file -> > ---------- > header('Content-type: text/css'); > header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' > GMT'); > header('Last-Modified: ' . gmdate('D, d M Y H:i:s', > filemtime('./foo.php')) . ' GMT'); > -------- > > For the life of me, according to the output of ethereal (a network > sniffer), this file is always fetched from the server. > Yes I did breeze by the HTTP 1.1 spec, but I didn't pick up on anything > special that I should be doing. > > Is there a way to make the file be put into cache, or am I barking up > the wrong tree. > > Thanks for your insight.

« previous php.general (#149760) next »