Why does IE11 send 'pragma: no-cache' in r

2019-06-18 23:36发布

问题:

I am testing my web page on IE11. I am making some ajax calls and setting response headers as

Cache-Control: private, max-age=21600;

Though everytime making a request, IE11 sets Pragma:no-cache request header. Causing request to get served from origin, though it should have been present in cache.\

Why does IE do that? Is there any way in IE to ignore this header?

Thanks.

回答1:

I have tracked this down using Fiddler. It's a red herring. IE11 only sends the praga:no-cache header when the development tools are open.

If you press F12 and close the development tools you will find that the no-cache header is not actually sent on each request. If you just have the development tools open, the no-cache header is sent.

You can check it out using fiddler.
Hope it helps...



回答2:

You can turn that off when the tools are open by deselecting the circled button: