【问题标题】:ASP.net web page still displaying cached versions [duplicate]ASP.net 网页仍显示缓存版本 [重复]
【发布时间】:2011-02-15 04:29:01
【问题描述】:

可能重复:
IIS 7 Force Fresh Images

我的网页仍在显示该页面以前缓存的版本。

我在 page_load 事件中有这个:

    Response.Clear();
    Response.Buffer = true;
    Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
    Response.Expires = -1;
    Response.CacheControl = "no-cache";
    Response.Cache.SetCacheability(HttpCacheability.NoCache);

我在 Page_Init 中有这个:

protected void Page_Init(object Sender, EventArgs e)
{
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
}

知道我可能缺少什么吗?

【问题讨论】:

    标签: c# asp.net .net-3.5


    【解决方案1】:

    有时您需要刷新浏览器。如果您使用 IE,有帮助的工具是 IE Toolbar for Developers with Fiddler。

    对于 firefox,请使用 Firebug 和 Fiddler。

    【讨论】:

      猜你喜欢
      • 2022-01-15
      • 1970-01-01
      • 1970-01-01
      • 2010-12-24
      • 1970-01-01
      • 1970-01-01
      • 2010-10-25
      • 1970-01-01
      • 2012-01-18
      相关资源
      最近更新 更多