代码之家  ›  专栏  ›  技术社区  ›  Stefan Kendall

是否使用HTTP响应头通过HTTPS强制不缓存Internet Explorer?

  •  1
  • Stefan Kendall  · 技术社区  · 14 年前

    所以,我最近发现了这个小宝石。

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

    基本上,我没有 Cache-Control: no-cache 通过https,这会破坏下载。但是,我需要在我的应用程序中禁用缓存许多响应,这些响应与我可以轻松控制的IO写入路径相同。

    有没有一种方法可以解决这个问题,这样我就可以在IE中通过HTTPS强制不使用任何缓存,只使用响应头?期望我的用户进行注册表更改来修复IE的破坏行为是不现实的。

    4 回复  |  直到 13 年前
        1
  •  1
  •   Stefan Kendall    14 年前

        2
  •  0
  •   Affe    14 年前

    response.reset(); //workaround IE restriction against streaming to cache from SSL
    response.setContentType("myMIMEType");
    response.setHeader("Content-Disposition", "attachment; filename=\"" + whateverGoesHere + "\"");
    

    attachment;

        3
  •  0
  •   Clement P    13 年前

    Pragma: private
    Cache-Control: private, must-revalidate
    

        4
  •  -1
  •   Michael Barker    14 年前

    Pragma: no-cache
    

    HTTP Spec