HttpCachePolicy 和 SSL
我有一个允许用户下载 csv 的应用程序。当不使用 SSL 时,这非常有效。但是,当使用安全连接时,我收到“Internet Explorer 无法打开此 Internet 站点”的消息。我知道问题与我的 HttpCaching 策略有关。以下 MS 支持文档解释了该问题:http://support.microsoft.com/kb/316431 但是,我似乎无法让它工作。有什么想法吗?
HttpCachePolicy cachePolicy = Response.Cache;
cachePolicy.SetCacheability(HttpCacheability.Private);
cachePolicy.SetNoStore();
cachePolicy.SetMaxAge(new TimeSpan(0L));
cachePolicy.SetRevalidation(HttpCacheRevalidation.AllCaches);
我尝试了不同 HttpCacheability 类型的组合。
I have an application that allows the user to download a csv. This works great when not using SSL. However, when using a secure connection I get the "Internet Explorer was not able to open this Internet Site". I know that the problem has to do with my HttpCaching policy. The following MS Support document explains the issue: http://support.microsoft.com/kb/316431 However, I cannot seem to get it to work. Any ideas?
HttpCachePolicy cachePolicy = Response.Cache;
cachePolicy.SetCacheability(HttpCacheability.Private);
cachePolicy.SetNoStore();
cachePolicy.SetMaxAge(new TimeSpan(0L));
cachePolicy.SetRevalidation(HttpCacheRevalidation.AllCaches);
I have tried a combination of different HttpCacheability types.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现在显式设置可缓存性之前清除标头可以解决此问题。
Response.Clearheaders();
I found that clearing the headers before explicitly setting the Cacheability resolved this issue.
Response.Clearheaders();