“HttpContext.Current.Cache” has a metod to remove items one by one with their key names.
If you want to remove all items from the cache you can use this little code snippet to achive this task:
IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();
while (enumerator.MoveNext())
{
HttpContext.Current.Cache.Remove(enumerator.Key.ToString());
}
Happy coding…
P.S.: This techique don’t effect the output cached pages.