Re: Caching
| From: | Pablo Vera | Date: | Mon, 28 Aug 2000 14:30:57 +0000 |
| Subject: | Re: Caching | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2225@lists.php.net to get a copy of this message | ||
JtB> I've seen an answer on this previously, but I lost that mail...
JtB> What do you put in the header for proxies and browsers NOT to cache the
JtB> current page's ?
JtB> Thx in advance,
JtB> Jeroen.
Jeroen:
From the PHP Manual, XX. HTTP functions, header() ---
PHP scripts often generate dynamic HTML that must not be cached by the
client browser or any proxy caches between the server and the client
browser. Many proxies and clients can be forced to disable caching
with:
1
2 header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
3 header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
4 // always modified
5 header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
6 header ("Pragma: no-cache"); // HTTP/1.0
7
The header function MUST be used before any output is sent to the browser.
Saludos,
Pablo Vera