You could loop through all the cache items and delete them one by one:
foreach (System.Collections.DictionaryEntry entry in HttpContext.Current.Cache){
HttpContext.Current.Cache.Remove(string(entry.Key));
}
Syntax Correction for ASP.NET 4.5 C#
foreach (System.Collections.DictionaryEntry entry in HttpContext.Current.Cache){
HttpContext.Current.Cache.Remove((string)entry.Key);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…