public void GenerateStats() { stats = new SystemStatistics(); // disable caching for dev // implement caching for 1 minute //Videos = (List<Video>)System.Web.HttpContext.Current.Cache[CacheKey]; //if (System.Web.HttpContext.Current.Cache.Get(CacheKey) == null) //{ // Videos = Video.GetTop100Videos((TopVideoType)TabType); // System.Web.HttpContext.Current.Cache.Insert(CacheKey, Videos, null, DateTime.Now.AddMinutes(CacheForMinutes), System.Web.Caching.Cache.NoSlidingExpiration); //} }
public void GenerateStats() { // disable caching for dev // implement caching for 1 minute string CacheKey = "Stats"; stats = (SystemStatistics)System.Web.HttpContext.Current.Cache[CacheKey]; if (System.Web.HttpContext.Current.Cache.Get(CacheKey) == null) { stats = new SystemStatistics(); System.Web.HttpContext.Current.Cache.Insert(CacheKey, stats, null, DateTime.Now.AddMinutes(1), System.Web.Caching.Cache.NoSlidingExpiration); } }