How to Clear Page Cache in ASP.NET on some event.

This is the article which will tells you that How to clean the Page Cache in asp.net based on the user action . We all will be using the Output cache in asp.net to cash our pages . What if you need to clear out the cache on some button click or page event. Let us see here How to Clear Page Cache in ASP.NET on some event.

As we all know ,this is the code we are using for OutputCache.

<%@OutputCache Duration="600" VaryByParam="*" %>

Here below I am giving the code for clearing the page cache.

HttpResponse.RemoveOutputCacheItem("/caching/CacheForever.aspx");

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *