RE: [PHP] Cache Control with forms

From: Date: Fri, 20 Apr 2001 13:44:37 +0000
Subject: RE: [PHP] Cache Control with forms
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49569@lists.php.net to get a copy of this message
Rasmus, thanks a lot!! Your information has been very helpful because now I know more ways to play with the headers!. Still, I am almost sure that it's possible to do what I want to do because I think I've seen such behaviour in other websites, for example Yahoo! Mail (note that the site does not have to be programmed in PHP because we are talking about then client behaviour, not the server's). Thanks a lot again, I am sure with your information I'll be able to work it out... and then I'll post the solution here! Cheers, Diego. -----Original Message----- From: Rasmus Lerdorf [mailto:rasmus@php.net] Sent: Thursday, 19 April, 2001 8:34 PM To: Diego Fulgueira Cc: Php-General Subject: Re: [PHP] Cache Control with forms > Hi everyone! I have the following problem: > I don't want any of my site's pages to be saved on any browser's cache. > Yet, I want all HTML forms to keep their data when the user changes to > another page without submiting and then comes back using the back button. > > I have seen changing the session.cache_limiter configuration option to > 'private' instead of 'nocache' works to make all forms keep their data, but > then all pages are diplayed from the browser's cache even after refreshing > several times!. I want a point in between, but I don't know how to get > there. > > By the way, do you know what do the values that session.cache_limiter can > take mean? (nocache, private and public) When you set it to 'nocache' you get a set of HTTP headers that look like this: Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache That forces things to not be cached anywhere. The 'private' setting sends these headers: Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: private, max-age=10800, pre-check=10800 The expires header is set to a time in the past to force non-HTTP 1.1 compliant caches not to cache the page. For HTTP-1.1 caches that understand the cache-control header the page will be cached only in private caches (ie. the end-user http-1.1 compliant browser) for the time specified by the session.cache_expire setting. The 'public' setting sends headers like this: Expires: Thu, 19 Apr 2001 20:57:16 GMT Cache-Control: public, max-age=10800 Basically this means that the page is allowed to be cached in both public (like AOL's proxy-cache) and private caches for the time specified by session.cache_expire And no, I don't know of a way to do what you want. I don't think you can have the back button working and at the same time not allow private caching. -Rasmus -- 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

« previous php.general (#49569) next »