disabling page caching, yes or no
| From: | Noel Akins | Date: | Wed, 31 Jan 2001 01:58:20 +0000 |
| Subject: | disabling page caching, yes or no | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-37433@lists.php.net to get a copy of this message | ||
Hello,
I'm trying to build the first page to a database driven website. The first thing I'm trying to do is detect if cookies are enabled on the users browser, and then, via a header(location: mysite.php), redirect the user to either a cookie supported page, or cookie unsupported page. I will use sessions, in some form or another on each.
My concern is that this first page, or any following page, not be cached. In the #php channel, it was said, or I understood from what was said, that by default, php pages aren't cached. It was also mentioned that I should make each url unique by using time() or uid of some kind. In the php manual, under Header(), it listed four ways to disable caching. they are:
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"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
Should I be concerned about page caching? If so, should I use one of the header() statements, a combination of header() statements? Can I use a combination of header() statements? The first page can't have a unique url. The following one would be unique by use of sessions I would think, but that may not keep them from being cached, would it?
Any direction would be of great help to me.
Thanks