Why does IE11 send 'pragma: no-cache' in request header for ajax requests?

拈花ヽ惹草 提交于 2019-12-23 09:13:50

问题


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:



来源:https://stackoverflow.com/questions/25157793/why-does-ie11-send-pragma-no-cache-in-request-header-for-ajax-requests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!