> 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?

You can use as many headers as you like, though some conflict with each
other.  EG:  Location: and SetCookie() don't play well together.

The 4 headers mentioned will convince most browsers not to cache your page,
but there are always some that are going to mess up.

By forcing each URL to be unique with some random nonsensical part in it,
virtually every browser will be fooled into thinking it's a different page
and won't retrieve an old one from the cache.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to