Re: Help me to win the battle with browser's cache
| From: | Girish Nath | Date: | Mon, 12 Nov 2001 14:29:55 +0000 |
| Subject: | Re: Help me to win the battle with browser's cache | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-74288@lists.php.net to get a copy of this message | ||
Hi
I've found some code which i put it into this function. I've never got the
meta tag technique to work but this seems to do the trick.
Call noCache() before outputting anything to the page.
function noCache() {
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-cache, must-revalidate"); file://HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
}
Regards
Girish
----- Original Message -----
From: "Olexandr Vynnychenko" <supaboy@i.com.ua>
To: <php-general@lists.php.net>
Sent: Monday, November 12, 2001 1:32 PM
Subject: [PHP] Help me to win the battle with browser's cache
> Hello php-general,
>
> I have index.php, which has <a href="index.php?logout">Log out</a>.
> When I click it, I am logged out the site. But I type "index.php" in
> browser's address bar, press Enter and ... it shows "non-logouted"
> page. What should I write in php code to tell browser something like
> "forget about old page, don't display it, get the newest version"?
> Some time ago I tried to do that in several ways and nothing gived
> 100% result. And other thing I saw was that Netscape and Explorer
> behave in different ways in such cases. Could someone help me? Maybe
> this topic was discussed before, but still... I appreciate greatly
> any suggestion.
>
> --
> Olexandr Vynnychenko
> mailto:supaboy@i.com.ua
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>