IE会先从服务器获取文档, 缓存到本地, 然后打开, 或另存为别的文档.
然而又的web服务器会在发给IE客户端的响应里包含一条信息, 不允许IE缓存到本地.
HTTP/1.1 200 OK
Cache-Control: no-store
Content-Length: 78336
Content-Type: application/vnd.ms-word.document.12
Last-Modified: Mon, 20 Aug 2007 06:31:27 GMT
如果是这样, 那么IE将无法直接打开这个文档, 或执行下载动作.
解决方案是修改一个注册表键值为0x1:
影响所有用户:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\BypassHTTPNoCacheCheck
影响当前用户:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\BypassHTTPNoCacheCheck
类型: DWORD
值: 0x1
该键值会强制准许IE缓存文件, 而不管server端发过来的是否缓存的请求.
MakeIEPassCachCheck.vbs
on error resume next
set wshShell=wscript.CreateObject("wscript.shell")
wshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\BypassHTTPNoCacheCheck", 1, "REG_DWORD"
资料来源:
Internet Explorer file downloads over SSL do not work with the cache control headers