caching - Clear the cache at a specific time in ASP.NET 2.0 -
Then I have a process that runs at midnight, which sets a start and end point for the flash object. It needs to be run only once, so I'm clearly caching the result set.
However, the problem I am running is that, if the data is still cached after Midnight, then it is not dragging it into the most accurate data, until the cache expires.
I basically need cache to end 11: 59:59 pm, so at 12:00 it gets the right data.
I'm guessing SQL cache dependency on the table that I am pulling data, that would be ideal, although I have never set it before.
Is the cache a specific
- complete termination ---
I think I have found:
Date time expiration width = new date time (date time.N. year, date time.Nob death, date time.Now day, 23, 59, 59, 99); Cache.intert ("cacheit name", itemcatch, blank, ending intersections, system web caching. Without lifting latching);
You can set a complete end time on the cache object, which is the date time .
You can also add a complete closing with a SqlCacheDependency.
About the issue of not pulling new data when the cache expires: You can wire the CacheItemRemovedCallback to receive notification of this when the cache expires , And refreshes it.
Comments
Post a Comment