Cache Control
| From: | Jeff Sittler | Date: | Mon, 19 Nov 2001 05:27:37 +0000 |
| Subject: | Cache Control | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-75070@lists.php.net to get a copy of this message | ||
How do I set a page to cache for only 5 minutes?
In ASP, I ahve used:
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
if Session("svUsername") = "" then response.redirect
"../login/accessDenied.asp"
%>
and I could just change the Response.Expires to how ever many seconds I
wanted the page to stay cached.
My PHP scripts, I'm using:
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
I don't see an option where I can tell it to cache for say 5 minutes.
Any help would be appreciated.
Jeff