Welcome to AspAdvice Sign in | Join | Help

Orcs Goblins and .NET

I enjoy reading and writing. I hope you enjoy at least the former.

Clearing Page Output Cache Entries

Earlier today I had a situation where I needed to clear the output cache entry of a page. After a quick Google search I turned up Steve Smith’s Article on Removing Page Output Cache Entries.

The article is a short, helpful article which quickly and easily explains how to remove the output cache entry of a page.

private void RemoveButton_Click(object sender, System.EventArgs e)
{
    HttpResponse.RemoveOutputCacheItem("/caching/CacheForever.aspx");
}

I hope everyone else finds this to be easy to understand and implement. The above should work as long as you have a page named “CacheForever.aspx” in the folder “caching” at the root of the site.

Happy Caching!

Sponsor

Published Monday, June 11, 2007 2:14 PM by Brendan

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Clearing Page Output Cache Entries @ Monday, July 16, 2007 7:01 PM

Thanks for this post. 2nd result in google when I was searching for this solution, and is exactly what I wanted. Cheers buddy.

Steven Nagy

# re: Clearing Page Output Cache Entries @ Monday, September 03, 2007 11:53 AM

Try this: HttpResponse.RemoveOutputCacheItem(Request.Path); or HttpResponse.RemoveOutputCacheItem(Request.CurrentExecutionFilePath);

mark

Leave a Comment

(required) 
required 
(required) 
Enter the code you see below