How to : Dynamically Remove ASP.NET Page Output Cache Entries

I have sought for a perfect solution for a long time and eventually get following old links :

-

--- Truely , I get what I need : a simple method :

public static void HttpResponse.RemoveOutputCacheItem( string path )

I just need it to flush an in-caching page when a post-back-action triggering . For example , in an article-comments page context , normally it is cached ; however , when a user post a new comment , process is expected to have the cached version overthrown and welcome a new generated one to ensure display of fresh comments ---- whether current cache version expires or not. After flushing , the new version keeps to the rules of caching game.

To dynamically remove a page output cache through this method always meets thorny problems in traditional "honest page" context : it will remove all versions of a single page which are varied by params ( mostly ,querystring ). For example , a user visits page

~/article.aspx?articleId=100

and makes a comment , thread's calling above method may evict thouthand of articles pages ( with different articleId ) from cache but what I really need is just the flush of target article !

It is indeed a trouble and out of my idea; However , using the fresh , exciting asp.net 3.5 "Routing" technology can perfectly circumvent the rock , making things smooth : "article/100" and "article/101" are treated as two different pages. Since "Different versions of the same page" becomes "Different pages" , we will not have "outputCache-queryString-version" nightmare any more !

Later I will make a series of posts to discuss the application of asp.net 3.5 "web-form-based routing" technology.

Published Monday, March 09, 2009 5:07 PM by zc0000

Comments

# re: How to : Dynamically Remove ASP.NET Page Output Cache Entries

Wednesday, September 29, 2010 4:20 AM by abercrombie & fitch

and makes a comment , thread's calling above method may evict thouthand of articles pages ( with different articleId ) from cache but what I really need is just the flush of target article !

# re: How to : Dynamically Remove ASP.NET Page Output Cache Entries

Sunday, November 25, 2012 8:01 PM by 1:1 louis vuitton

More than and over again I consider these issue. As a matter of fact it was not even yesterday that I last thought about it. To be honest, what is your thought though?

1:1 louis vuitton http://www.lvoutleter.com

# re: How to : Dynamically Remove ASP.NET Page Output Cache Entries

Thursday, February 07, 2013 6:36 AM by Kayla

Wow! I could not even guess about it)) Not bad.

Leave a Comment

(required) 
(required) 
(optional)
(required)