System.Web.UI.Page.Cache 页面 缓存 清除

这个也是网上查询到方法,不错记录一下!

/// <summary>
/// 清空所有的Cache
/// </summary>
public static void ClearCache()
{
List<string> cacheKeys = new List<string>();
IDictionaryEnumerator cacheEnum = HttpContext.Current.Cache.GetEnumerator();
while (cacheEnum.MoveNext())
{
cacheKeys.Add(cacheEnum.Key.ToString());
}
foreach (string cacheKey in cacheKeys)
{
HttpContext.Current.Cache.Remove(cacheKey);
}
}

上一篇:Abstractive Summarization


下一篇:【探路者】Postmortem会议(“事后诸葛亮”会议)