[Mod_gzip] "mod_gzip_send_vary=Yes" disables caching on IE? (1.3.26.1a)
Jordan Russell
mod_gzip@lists.over.net
Sat, 7 Dec 2002 21:06:05 -0600
"Slava Bizyayev" wrote:
> When you wish to control the client side cache you would consider to
provide
> the appropriate Expires header first. You can set the lifetime of your
> response in client's cache up to 1 year. This client will never bother you
> again until the expiration date (unless the user hits the Refresh button
> earlier).
...except in the case where there's a Vary header but no "Content-Encoding:
gzip" header, it seems.
In my tests, IE 6 will cache this OK:
header("Expires: Mon, 08 Dec 2003 00:00:00 GMT");
echo "Hi";
IE won't cache the following, though -- it acts as if the Expires header
isn't there. (Note: I cleared my browser cache before doing this test.)
header("Vary: Content-Encoding");
header("Expires: Mon, 08 Dec 2003 00:00:00 GMT");
echo "Hi";
(Again, by "won't cache" I mean the page gets reloaded on every visit, even
when you pass by it using the Back/Forward buttons in the browser.)
But then, as usual, if I add in gzip encoding, IE caches the page just fine:
header("Content-Encoding: gzip");
header("Vary: Content-Encoding");
header("Expires: Mon, 08 Dec 2003 00:00:00 GMT");
echo gzencode("Hi");
Jordan Russell