I’ve created a web site that uses classic ASP.NET caching:
DataSet ds = new DataSet();
ds = (DataSet) Cache["MyDataSet"];
In ASP.NET code, I’ve set the duration for several hours, however IIS resets cache much earlier.
In IIS, where can I manually set the duration of ASP.NET caching?
I have enough RAM, with fully loaded cache and working sites I have about 1/3 free (3GBtotal, Web Server 2008R2).
(I have heavy calculations (several minutes) that are in cache, and during work I update only small parts of cache)
When you add the object to the Cache, you can specify the expiration policy (absolute, sliding expiration).
See here for a more detailed explanation.
Here’s some reasons why an object may be removed from Cache: