ASP.NET comes with very powerful caching mechanism that can be used to easily improve responsiveness and efficiency of your web applications.
Here is the code snippet that clears all cached data in your web application:
public void ClearApplicationCache()
{
List<string> keys = new List<string>();
IDictionaryEnumerator enumerator = Cache.GetEnumerator();
while (enumerator.MoveNext())
{
keys.Add(enumerator.Key.ToString());
}
for (int i = 0; i < keys.Count; i++)
{
Cache.Remove(keys[i]);
}
}