johndillon wrote:
This still doesnt really get the source of my question "Where in code can I set how long NOP caches items for"?
By default the items are cached for 60 mins. see the code below.
So you can set application pool to never recycle or increase the time and increase the cacheTime too or get it as variabe from settings.
public static class CacheExtensions
{
public static T Get<T>(this ICacheManager cacheManager, string key, Func<T> acquire)
{
return Get(cacheManager, key,
60, acquire);
}
public static T Get<T>(this ICacheManager cacheManager, string key, int cacheTime, Func<T> acquire)
{
////igog it is needed
//return acquire();
if (cacheManager.IsSet(key))
{
return cacheManager.Get<T>(key);
}
else
{
var result = acquire();
//if (result != null)
cacheManager.Set(key, result, cacheTime);
return result;
}
}
}