Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Feb 01, 2011 01:26 PM|LINK
In a Windows application, I'm using Microsoft's Caching Block to store some static data I retrieve from a web service.
I've set the expiration as SlidingTime(TimeSpan.FromMinutes(10)) when adding a value into the cache manager.
However, I've noticed that calls to ICacheItemRefreshAction.Refresh are happening on a worker thread that most likely the Caching Block creates itself. Therefore there could be a situation when a call to ICachingManager.GetData(key) may not return anything
because the data has already been removed from the cache and the Refresh() method has not finished retrieving the new data yet.
Is there a way to get notified when it's time to refresh the data in cache yet at the same time keep the old data in cache?
Is there any other better solution than the Caching Block for this kind of a scenario?