In IE (8 at least, probably the rest too):
I make a request:
GET http://www.mydomain.com/ HTTP/1.1
the server responds with:
HTTP/1.1 200 OK
Cache-Control: private, must-revalidate
Last-Modified: Fri, 25 Mar 2011 10:52:34 GMT
Date: Fri, 25 Mar 2011 10:54:15 GMT
I make another request:
GET http://www.mydomain.com/ HTTP/1.1
If-Modified-Since: Fri, 25 Mar 2011 10:52:34 GMT
the server responds with:
HTTP/1.1 304 Not Modified
Cache-Control: private, must-revalidate
Last-Modified: Fri, 25 Mar 2011 10:52:34 GMT
I then goto some page, say:
http://www.mydomain.com/somepage
which has a link on it:
<a href="http://www.mydomain.com/">click me</a>
When I click this, IE displays the previously cached response for this the anchored URI, without even making a request.
Why is it not obeying must-revalidate? This works as I’d expect in FireFox and Webkit
How do I make it obey it?
Thanks
The problem is most likely that you haven’t set a
max-ageorExpiresin the response.Cache-Control: must-revalidatetells clients that once this resource expires, they must revalidate it against the origin:Since you don’t declare when the page becomes stale, IE8 relies on heuristics to make an educated guess. If you want IE to revalidate the page every time, you need to add appropriate headers to keep the expiry short: