I have the code like below. When I open the page for the first time I get the data from the query, subsequent times I open the page I get data from the cache and query didn't run. But when I open the page some time later, like 2 hours later, I don't get data from cache but instead the query runs again... If the absolute Expiration is set to more 26 hours, why cache is not available anymore after 2 hours? What am I missing here? There are some global parameter to configure maximum cache time at IIS or similar?
System.Data.DataTable dtData;
string cacheKey = "table_data";
if (Cache.Get(cacheKey) != null)
dtData = (System.Data.DataTable)Cache.Get(cacheKey);
else
{
dtData = QueryData;
Cache.Insert(cacheKey, dtData, null, DateTime.Now.AddHours(26), TimeSpan.Zero);
}