Internet Explorer不会缓存静态文件

时间:2019-02-21 13:42:51

标签: apache internet-explorer caching http-headers

获得此响应标头(请求一些静态文件,即* .css):

HTTP/1.1 200 OK
Content-Type: text/css
Keep-Alive: timeout=5, max=99
Set-Cookie: merp_session=eec953c0214e1; path=/; expires=Thu, 21-Feb-2019 15:34:06 GMT; HttpOnly
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT
Content-Encoding: gzip
Access-Control-Max-Age: 1000
Access-Control-Allow-Headers: x-requested-with, Content-Type, origin, authorization, accept, client-security-token, X-Merp-Session-Id, Access-Control-Allow-Headers, Access-Control-Expose-Headers, Access-Control-Allow-Origin
Expires: Fri, 22 Feb 2019 13:34:06 GMT
Cache-Control: max-age=86400, private
Date: Thu, 21 Feb 2019 13:34:06 GMT
Transfer-Encoding: Identity
Access-Control-Allow-Credentials: true
Connection: Keep-Alive
Vary: Accept-Encoding
Last-Modified: Wed, 06 Feb 2019 11:05:35 GMT
Server: Apache/2.4.29 (Ubuntu)
X-Catalyst: 5.90115

任何其他浏览器都会从本地缓存中获取静态信息,但是IE总是会再次再次请求我服务器中的所有文件。

我应该设置哪种响应头来强制IE本地缓存?

1 个答案:

答案 0 :(得分:0)

尝试打开F12开发人员工具的“网络”标签,并检查您是否已打开the "Always refresh from server" option

此选项是具有打开和关闭状态的拨动开关。启用后,Internet Explorer 11从远程服务器而不是从浏览器缓存中下载所有页面元素。

enter image description here

编辑:

此外,您还可以检查"Check for Newer Versions of Stored Pages" setting