NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP pages cache in spite of header() - ideas?

Patrick Hunt pat at vote.com
Fri Aug 1 23:41:26 EDT 2003


Phil,
I've had EXTREMELY mixed results with the 'replace' parameter of
the header function, so I suspect it's broken in some versions of
PHP. I've had good results with combining all the Cache-Control
directives into one call to header(). I'd also add 'private' to the
list of Cache-Control params.


--Original Message Text---
From: Phil Powell
Date: Fri, 1 Aug 2003 23:23:35 -0400

// PREVENT CACHING FIRST BEFORE ANYTHING ELSE!
  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in
the past
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); //
always modified
  header("Cache-Control: no-store, no-cache, must-revalidate");  //
HTTP/1.1
  header("Cache-Control: post-check=0, pre-check=0", false);
  header("Pragma: no-cache");                          // HTTP/1.0 
 
I am using the following commands to force the PHP script to not
cache; however, it still does cache.  Browser settings were checked
and corrected; yet it still caches. 
 
Suggestions? 
 
Phil 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030801/f746fb9a/attachment.html>


More information about the talk mailing list