So I have a process which runs at midnight which sets a start and end point for a flash object. This only needs to run once a day, so I'm obviously caching the result set.
However, the problem I'm running into is, if the data is still cached after midnite, it's not pulling in the most correct data, until the cache expires.
I basically need the cache to expire at 11:59:59PM, so that at 12:00am it gets the correct data.
I'm guessing a SQL Cache Dependency on the table I'm pulling the data from would be ideal, however I have never set that up before.
Is there a way to tell the cache to remove a specific item at exactly midnite?
Thanks guys!
--Absolute Expiration---
I think I got it:
DateTime expireWeights = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59, 999);
Cache.Insert("CacheItemName", itemToCache, null, expireWeights, System.Web.Caching.Cache.NoSlidingExpiration);