A New Approach to HttpRuntime.Cache Management
page 5 of 9
by David Penton
Average Rating: 
Views (Total / Last 10 Days): 76628/ 238

Other Benefits

This pattern does provide for background refreshing and updating of the cache. This is done through the CacheItemRemovedCallback. Here is how it works. If your cache item was requested one time from the cache (as in to populate it) then when the expiration time comes, the cache item expires based upon the rules that the developer set. If there is subsequent access from the cache item, that information is recorded. When it comes time to expire, it places the original data back into the cache with a CachePriority.Low and a short time to keep it in the cache. After that, a delegate is added to System.Threading.ThreadPool.QueueUserWorkItem so that the data may be refreshed on a background thread. Since all of the details to refresh each item in cache are stored, all that is needed for discovery is the cache key. For explicit details on this implementation, see TCache.ItemRemovedCallback in the CacheExtension project.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2020 ASPAlliance.com  |  Page Processed at 2020-04-04 11:42:02 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search