Re: [PHP] How to specify to browser to cache contents?
Chris Shiflett wrote: > > Luckily, it doesn't matter too much where it is set, because you should > be able to set your own with PHP (I think PHP may set it actually when > you use PHP's sessions). First, try something simple: > > header("Cache-Control: no-cache"); I'll try that! But what I want is for the browser to use the cached copy if the server copy has not changed. Will no-cache do this? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to specify to browser to cache contents?
Luckily, it doesn't matter too much where it is set, because you should be able to set your own with PHP (I think PHP may set it actually when you use PHP's sessions). First, try something simple: header("Cache-Control: no-cache"); See if that does the trick. Do you have any way of viewing the HTTP transaction to be sure? Chris Jean-Christian Imbeault wrote: > Where is this "no-store"/"no-cache" directive? PHP, Apache? I don't > remember "intentionally" setting it :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to specify to browser to cache contents?
Chris Shiflett wrote: > > IE ignores the "no-store" directive of the Cache-Control header, and > this is the most common reason behind behavior such as you are > describing. Exactly as I was worrying ... > Get rid of "no-store" and just use "no-cache" instead to see if it > resolves the inconsistency. Where is this "no-store"/"no-cache" directive? PHP, Apache? I don't remember "intentionally" setting it :) Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to specify to browser to cache contents?
IE ignores the "no-store" directive of the Cache-Control header, and this is the most common reason behind behavior such as you are describing. Basically, because Netscape (and other browsers) adhere to the HTTP specification, it may appear as if they are misbehaving when it in fact quite the opposite. Get rid of "no-store" and just use "no-cache" instead to see if it resolves the inconsistency. Happy hacking. Chris Jean-Christian Imbeault wrote: > The two browsers in question are N7 and IE5.5 N7 is the one that > "seems" not to be caching. In my opinion IE5 often has "features" that > make it do things it shouldn't just because it might be helpful to the > user. > > So I was thinking IE5.5 was doing some caching because *it* thought it > should but N7 wasn't because it was respecting some HTTP header saying > not to cache that I somehow have set by mistake ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to specify to browser to cache contents?
Justin French wrote: > > If there's a noticeable difference between two browsers, and you're > currently NOT setting any headers for caching, the blame will probably lie > in the preference setting of the browser, not in your code. I thought exactly the same thing before posting. So I made sure cookies are enabled and that the cache setting is "Once per session". The two browsers in question are N7 and IE5.5 N7 is the one that "seems" not to be caching. In my opinion IE5 often has "features" that make it do things it shouldn't just because it might be helpful to the user. So I was thinking IE5.5 was doing some caching because *it* thought it should but N7 wasn't because it was respecting some HTTP header saying not to cache that I somehow have set by mistake ... How can I get the entire page, HTTP headers and all so I can see if there are some no caching directives in the page? And which headers might those be? ;) Thanks! Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to specify to browser to cache contents?
If there's a noticeable difference between two browsers, and you're currently NOT setting any headers for caching, the blame will probably lie in the preference setting of the browser, not in your code. Justin French on 30/09/02 2:24 PM, Jean-Christian Imbeault ([EMAIL PROTECTED]) wrote: > Is the a particular header() call or other setting I can use to tell the > client browser to cache the contents of my php pages? (I am using Apache). > > It seems like my browser (N7) doesn't even cache the images on the pages > even though those are static ... > > Jc > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to specify to browser to cache contents?
Is the a particular header() call or other setting I can use to tell the client browser to cache the contents of my php pages? (I am using Apache). It seems like my browser (N7) doesn't even cache the images on the pages even though those are static ... Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php