Clear the ASP.Net Application Cache

I needed a quick way to clear the cache when I was debugging an issue, and couldn’t seem to find anything that worked right away online. So, created a quick foreach to handle cleaning everything up. Short and simple, thought I’d post to help anybody else out having the same issue

foreach(DictionaryEntry item in HttpContext.Current.Cache)
{
	HttpContext.Current.Cache.Remove(item.Key.ToString());
}   

HTH, thanks!

Releated Post

Leave a Reply

%d bloggers like this: