Is there any tool available for viewing cached data in HttpRunTime cache..?
We have an Asp.Net application which is caching data into HttpRuntime Cache. Default value given was 60 seconds, but later changed to 5 minutes. But feels that the cached data is refreshing before 5 minutes. Don't know what is happening underneath.
Is there any tool available or how we can see the data cached in HttpRunTime Cache.... with expiration time...?
Following code is using for add items to cache.
public static void Add(string pName, object pValue)
{
int cacheExpiry= int.TryParse(System.Configuration.ConfigurationManager.AppSettings["CacheExpirationInSec"], out cacheExpiry)?cacheExpiry:60;
System.Web.HttpRuntime.Cache.Add(pName, pValue, null, DateTime.Now.AddSeconds(cacheExpiry), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.High, null);
}
Thanks.
The Cache class supports an IDictionaryEnumerator to enumerate over all keys and values in the cache.
But I don't believe there is any official way to access metadata such as expiration time.