Is there a method or something to force the expiration of all of the entries in the Cache collection of the HttpContext?
Try something like this:
var enumerator = HttpRuntime.Cache.GetEnumerator();
Dictionary<string, object> cacheItems = new Dictionary<string, object>();
while (enumerator.MoveNext())
cacheItems.Add(enumerator.Key.ToString(), enumerator.Value);
foreach (string key in cacheItems.Keys)
HttpRuntime.Cache.Remove(key);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With