|
小议优化ASP.NET应用性能之Cache篇(3) 48 49 public static void Insert(string key, object obj, int seconds) 50 { 51 Insert(key, obj, null, seconds); 52 } 53 54 public static void Insert(string key, object obj, CacheDependency dep) 55 { 56 Insert(key, obj, dep, HourFactor*12); 57 } 58 59 public static void Insert(string key, object obj, int seconds, CacheItemPriority priority) 60 { 61 Insert(key, obj, null, seconds, priority); 62 } 63 64 public static void Insert(string key, object obj, CacheDependency dep, int seconds) 65 { 66 Insert(key, obj, dep, seconds, CacheItemPriority.Normal); 67 } 68 69 public static void Insert(string key, object obj, CacheDependency dep, int seconds, CacheItemPriority priority) 70 { 71 if (obj != null) 72 { 73 _cache.Insert(key, obj, dep, DateTime.Now.AddSeconds((double) (Factor*seconds)), TimeSpan.Zero, priority, null);
|