Alex Rivera | Logout

Internet Explorer 9 ignoring no cache headers

Asked 2011-11-23T09:12:11.790
11

I'm tearing my hair out over Internet Explorer 9's caching.

I set a series of cookies from a perl script depending on a query string value. These cookies hold information about various things on the page like banners and colours.

The problem I'm having is that in IE9 it will always, ALWAYS, use the cache instead of using the new values. The sequence of events runs like this:

  1. Visit www.example.com/?color=blue
  2. Perl script sets cookies, I am redirected back to www.example.com
  3. Colours are blue, everything is as expected.
  4. Visit www.example.com/?color=red
  5. Cookies set, redirected, colours set to red, all is normal
  6. Re-visit www.example.com/?color=blue
  7. Perl Script runs, cookies are re-set (I have confirmed this) but! IE9 retreives all resources from the cache, so on redirect all my colours stay red.

So, every time I visit a new URL it gets the resources fresh, but each time I visit a previously visited URL it retrieves them from the cache.

The following meta tags are in the <head> of example.com, which I thought would prevent the cache from being used:

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> 
<META HTTP-EQUIV="EXPIRES" CONTENT="0">

For what it's worth - I've also tried <META HTTP-EQUIV="EXPIRES" CONTENT="-1">

IE9 seems to ignore ALL these directives. The only time I've had success so far in that browser is by using developer tools and ensuring that it is manually set to "Always refresh from server"

Why is IE ignoring my headers, and how can I force it to check the server each time?

Edit
Report

2 Answers

3

Try sending the following as HTTP Headers (not meta tags):

Cache-Control: private, must-revalidate, max-age=0
Expires: Thu, 01 Jan 1970 00:00:00
answered 2011-12-14T17:57:14.043
0

Will just mention that I had a problem looking very like this. But I tried IE9 on a different computer and there was no issue. Then going to Internet Options -> General -> Delete and deleting everything restored correct behaviour. Deleting the cache was not sufficient.

answered 2012-08-27T12:47:45.603

Your Answer