• IE中直接打开文档和下载时的行为


    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

    http://support.microsoft.com/kb/323308

  • 相关阅读:
    Eclipse配置Maven详细教程
    Spring MVC 搭建web项目示例
    C# Action 和Func
    C# params 用法简介
    WPF绘图性能问题
    C# EventWaitHandle用法
    C#5.0 异步编程async/await用法
    通过Struts2Web应用框架深入理解MVC
    Java过滤器—Filter用法简介
    WPF内嵌CEF控件,与JS交互
  • 原文地址:https://www.cnblogs.com/awpatp/p/1711784.html
Copyright © 2020-2023  润新知