Reputation: 279
i am using EntityFramework-Plus to add Second level caching to an ASP.NET web forms / WebAPI application.
This will add cache items into the memory cache. All good and dandy so far. The problem is that my items are stored for very little time in the cache.
I can not find any information on the default values of the cache expiration, I want to have them stored as long as the server will have memory for it :)
How can I extend this properly for the entire application? How can I find out when the items will expire? And what other server limitations I might have related to this?
Any help will be highly appreciated, thank you
Upvotes: 0
Views: 846
Reputation: 14555
See the QueryCacheManager
static class and set one of the DefaultCacheItemPolicy
's members to the time you want.
For example:
var options = new CacheItemPolicy() { SlidingExpiration = TimeSpan.FromHours(2)};
QueryCacheManager.DefaultCacheItemPolicy = options;
Upvotes: 3