Re: no-cache headers
| From: | Matt | Date: | Mon, 18 Feb 2002 12:39:46 +0000 |
| Subject: | Re: no-cache headers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85179@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Phil Ewington" <phil@n-igma.net>
> I am new to PHP and am having problems with no-cache headers, I have the
> following code added as the first line of code in the page...
>
> <?
> header("Expires: Mon, 01 Jan 1997 00:00:00 GMT");
> header("Cache-Control: no-store, no-cache, must-revalidate");
> header("Pragma: no-cache");
> ?>
>
> A combination of no-cache headers usually does the trick, well in
ColdFusion
> anyway :o), yet this code still shows the wrong images after an upload
until
> a refresh of the browser is performed. Have I done something wrong or are
> headers not very reliable in PHP?
Those are fine. I also add:
<meta content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Expires" content="Mon, 06 Jan 1990 00:00:01 GMT">
If you just added the cache control, then have you cleared the browser
cache? Once the page is cached, the browser will return it regardless of
the cache-control.