I am trying to cache a string in my .net mvc application for 24 hours. I am having trouble finding a way to get the cache to expire. Currently I set the cache using
System.Runtime.Caching.MemoryCache.Default["activeKey"] = "success";
I use the cache by calling
var activeKey = System.Runtime.Caching.MemoryCache.Default["activeKey"];
if (activeKey != null && (string) activeKey == "success")
{
return true;
}
However, I am unsure where to go from here as far as cache. I found docs for sliding and absolute cache, but am unsure exactly what to do.