Expiring the Page Output Cache Programmatically
You can remove a page from the cache programmatically by using the
Response.RemoveOutputCacheItem() method. For example, imagine that you are caching a page that displays a list of products. Furthermore, imagine that your website includes a separate page for adding a new product. In that case, you want to remove the first page programmatically from the cache when the list of products is updated.
The page in Listing 29.11 uses a
GridView control to display a list of movies. The page is cached for 1 hour with an
<%@ OutputCache %> directive.
The page in Listing 29.12 ...