public class CacheManage
{
public static Object GetCache(string cacheKey)
{
if (HttpRuntime.Cache[cacheKey] != null)
{
return HttpRuntime.Cache[cacheKey];
}
return null;
}
public static void Insert(string cacheKey, Object obj)
{
HttpRuntime.Cache.Insert(cacheKey, obj, null, DateTime.Now.AddMinutes(60), System.Web.Caching.Cache.NoSlidingExpiration);
}
public static void Insert(string cacheKey, Object obj, int minutes)
{
HttpRuntime.Cache.Insert(cacheKey, obj, null, DateTime.Now.AddMinutes(minutes), System.Web.Caching.Cache.NoSlidingExpiration);
}
public static void Insert(string cacheKey, Object obj, double Seconds)
{
HttpRuntime.Cache.Insert(cacheKey, obj, null, DateTime.Now.AddSeconds(Seconds), System.Web.Caching.Cache.NoSlidingExpiration);
}
public static void Remove(string cacheKey)
{
HttpRuntime.Cache.Remove(cacheKey);
}
}