示例#1
0
 public static object Get(string cachekey)
 {
     if (HttpContext.Current.Cache[cachekey] != null)
     {
         //HttpContext.Current.Response.Write("CACHE_" + cachekey + "_");
         return(ConvertHelper.ByteArrayToObject(Compress.DecompressGZip((byte[])HttpContext.Current.Cache[cachekey])));
     }
     return(null);
 }
示例#2
0
 public static int CalcSize(object objToCache)
 {
     return(Compress.CompressGZip(ConvertHelper.ObjectToByteArray(objToCache)).Length);
 }
示例#3
0
 public static void Insert(string cachekey, object objToCache, int minutesToCache)
 {
     HttpContext.Current.Cache.Insert(cachekey, Compress.CompressGZip(ConvertHelper.ObjectToByteArray(objToCache)), null, DateTime.Now.AddMinutes(minutesToCache), System.Web.Caching.Cache.NoSlidingExpiration);
 }