I have an ASP.NET MVC 3 app hosted on IIS. This app is using MemoryCache to work with some data in memory to help minimize hits to my database. I would like this data to stay cached for up to a single day. In my code, I'm setting the following:
List<MyObject> myItems = GetMyItems();
CacheItemPolicy cachePolicy = new CacheItemPolicy();
cachePolicy.AbsoluteExpiration = new DateTimeOffset(DateTime.Now.AddMinutes(1440));
Cache.Set("myCacheKey", myItems, cachePolicy);
While my caching seems to be working. However, it does not seem to stay in the cache for the intended duration. Is there a setting I need to make in the web.config, if so, what setting? If not, is it an IIS setting that I need to set to enable a longer cache duration?