NYCPHP Meetup

NYPHP.org

[nycphp-talk] Overwriting Cache Headers

Michael B Allen ioplex at gmail.com
Sat Sep 13 23:41:00 EDT 2008


I want to send css and js files from a PHP script so I want to allow caching.

But PHP always sends the following headers:

Array
(
    [0] => X-Powered-By: PHP/5.2.6
    [1] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
    [2] => Cache-Control: no-store, no-cache, must-revalidate,
post-check=0, pre-check=0
    [3] => Pragma: no-cache
)

AFAIK it's not possible to remove or suppress headers but I can of
course overwrite them.

The question is: with what?

For the Expires header I suppose it could just be the RFC822 time for
now + 1 hour.

For the Cache-Control header it's less clear. Here's the spec but I'm
still trying to decipher the meaning of each directive:

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

For the Pragma header I'm largely clueless.

Does anyone know what values for these headers would be equivalent to
not specifying them at all?

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/



More information about the talk mailing list