On 02-Jun-2003 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.
> 

Try adding one more 'hint':

header('Cache-Control: max-age=3600');

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to