IE11为什么会在ajax请求的请求标头中发送"pragma:no-cache"? [英] Why does IE11 send 'pragma: no-cache' in request header for ajax requests?

查看:299
本文介绍了IE11为什么会在ajax请求的请求标头中发送"pragma:no-cache"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在IE11上测试我的网页.我正在进行一些Ajax调用并将响应标头设置为

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;

尽管每次发出请求,IE11都会设置Pragma:no-cache请求标头.导致请求从来源获得服务,尽管该请求应该已经存在于缓存中.\

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.\

为什么IE会那样做? IE中有什么方法可以忽略此标头?

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

谢谢.

推荐答案

我已经使用 Fiddler 对此进行了跟踪.这是 红鲱鱼 . IE11仅在打开开发工具时发送praga:no-cache标头.

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.

如果按F12并关闭开发工具,则会发现no-cache标头实际上并不是针对每个请求发送的.如果您只打开开发工具,则会发送no-cache标头.

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...

这篇关于IE11为什么会在ajax请求的请求标头中发送"pragma:no-cache"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆