Limo.Net Internet Services
Please Login or Register

Knowledgebase

Clear the .NET Application Cache

The code below clears all the cached data in your web application for .NET 
This is also can be used in ASP.NET MVC's OutputCachedPage.


public void ClearApplicationCache() { List keys = new List(); // retrieve application Cache enumerator IDictionaryEnumerator enumerator = Cache.GetEnumerator(); // copy all keys that currently exist in Cache while (enumerator.MoveNext()) { keys.Add(enumerator.Key.ToString()); } // delete every key from cache for (int i = 0; i < keys.Count; i++) { Cache.Remove(keys[i]); } }


Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article


Powered by WHMCompleteSolution

Language:

Quick Navigation

Client Login

Email

Password

Remember Me

Search