1

Asp.net 能够使用OutputCache指令缓存页面。如果发生回发,是否可以从缓存中删除页面?我尝试在 Page_load 中使用带有 IsPostback 条件的 RemoveOutputCacheItem(Absolute Page path),尽管代码运行页面顽固地保留在缓存中。

关于如何从缓存中清除页面的任何想法?

4

1 回答 1

1

尝试:

        if (IsPostBack)
        {
            Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
            Response.Expires = -1500;
            Response.CacheControl = "no-cache";
        }
于 2013-10-28T20:34:04.600 回答