views:

2331

answers:

2

A 302 Redirect is being returned after a post of information. This redirect is intended to reload the current page.

This all works fine, but IE adds No-Cache to the header:

Cache-Control: no-cache

We are using Squid to cache our content, and putting this in the header bypasses squid.
As this redirect is used quite often(there is no way around this), this increases load on our system substantially.

Firefox doesn't have this problem, it simply requests the redirected page without changing the header which is exactly what we want.

Is there anything we can do to stop IE from adding no-cache?

A: 

Sounds like a bug in IE to me. This discussion sounds similar. You could maybe try sending back a 301 or 307 response to see if it responds differently.

Marc Novakowski
That link just took me to windows experience images... no discussion.
James Camfield
+1  A: 

Fascinating. This is indeed an IE issue with no direct workaround. The problem is that IE will unconditionally add a Cache-Control: no-cache request header (or a Pragma: no-cache request header if you have a proxy) to a HTTP POST request.

This was doubtless introduced in IE over a decade ago to accomodate buggy proxy servers which did not properly handle HTTP POST requests and would incorrectly return cached responses.

A quirk of IE is that when you redirect, the no-cache headers are re-added to the redirected request. Hence, in your case, your redirected request also sends the "no-cache" request header carried over from the POST request.

Unfortunately, there's no direct workaround for this. You could redirect IE users to an interstitial page that uses JavaScript to redirect them back to the original page. (Don't use META REFRESH though, because that ALWAYS sends no-cache requests).

EricLaw -MSFT-