Salman Virk
Salman Virk

Reputation: 12317

How to tell IE6 not to cache the html/page?

I am using the following code using PHP,

header("Cache-control: private");
header('Expires: Mon, 26 Jul 2010 05:00:00 GMT');
header("Last-Modified: Mon, 26 Jul 2010 05:00:00 GMT");
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');

In all browsers it seems to be working fine but not in IE6 unless I hit Ctrl+F5 to forcefully refresh the page. How to stop caching in IE6?

Upvotes: 0

Views: 201

Answers (2)

Edson Medina
Edson Medina

Reputation: 10289

It's a bug. Check here:

Content with "Content-Encoding: gzip" Is Always Cached Although You Use "Cache-Control: no-cache" http://support.microsoft.com/kb/321722

Disabling gzip compression pretty much fixes it.

You could disable it just of user agents matching "MSIE 6".

Upvotes: 0

Related Questions