【问题标题】:setting cache-control header设置缓存控制头
【发布时间】:2011-10-01 07:04:43
【问题描述】:

我必须将缓存控制标头设置为“无缓存,无存储”。为此,我正在使用 html元标记

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

在网页的标签中。 我在萤火虫中进行了检查。尽管具有对所需的缓存控制的缓存控制,但它具有“私有”。 我正在使用 ASP.NET 框架。 知道为什么会失败吗?

【问题讨论】:

  • 你说“网页的标头部分”是指HTTP标头吗?

标签: asp.net meta-tags


【解决方案1】:

从你后面的代码中添加:

 Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetNoStore();

【讨论】:

  • 我特别遇到了一个问题,即在 IE(仅)中,Colorbox iframe 的内容被缓存在私有设置下,这解决了问题。谢谢!
猜你喜欢
  • 2012-02-19
  • 1970-01-01
  • 1970-01-01
  • 2019-01-14
  • 2012-02-06
  • 2018-12-29
  • 2023-04-01
  • 2018-06-19
  • 2013-04-01
相关资源
最近更新 更多