public void InsertToCache(string key, IContainerItemCollection value) { if (key == null || value == null) { return; } _cache[key] = value; }
public void InsertToCache(string key, IContainerItemCollection value)//TODO:添加Timeout参数 { if (string.IsNullOrEmpty(key) || value == null) { return; } var cacheKey = GetFinalKey(key); //TODO:加了绝对过期时间就会立即失效(再次获取后为null),memcache低版本的bug _cache.Store(StoreMode.Set, cacheKey, value, DateTime.Now.AddDays(1)); #if DEBUG value = _cache.Get(cacheKey) as IContainerItemCollection; #endif }
public void InsertToCache(string key, IContainerItemCollection value) { if (string.IsNullOrEmpty(key) || value == null) { return; } var cacheKey = GetFinalKey(key); //if (value is IDictionary) //{ // //Dictionary类型 //} _cache.StringSet(cacheKey, value.Serialize()); #if DEBUG var value1 = _cache.StringGet(cacheKey);//正常情况下可以得到 //_cache.GetValue(cacheKey); #endif }
public void Update(string key, IContainerItemCollection value) { _cache[key] = value; }
public void Update(string key, IContainerItemCollection value) { throw new NotImplementedException(); }
public void InsertToCache(string key, IContainerItemCollection value) { throw new NotImplementedException(); }
public void Update(string key, IContainerItemCollection value) { var cacheKey = GetFinalKey(key); _cache.StringSet(cacheKey, value.Serialize()); }
public void InsertToCache(string key, IContainerItemCollection value) { if (string.IsNullOrEmpty(key) || value == null) { return; } var cacheKey = GetFinalKey(key); if (value is IDictionary) { //Dictionary类型 } //TODO:加了绝对过期时间就会立即失效(再次获取后为null),memcache低版本的bug var hash = GetHash(); _cache.SetEntryInHash(hash, cacheKey, value); //_cache.SetEntry(cacheKey, obj); #if DEBUG var value1 = _cache.GetFromHash(cacheKey);//正常情况下可以得到 //_cache.GetValue(cacheKey); var value2 = _cache.GetValueFromHash(hash, cacheKey);//正常情况下可以得到 var value3 = _cache.GetValue(cacheKey);//null #endif }
public void Update(string key, IContainerItemCollection value) { var hash = GetHash(); _cache.SetEntryInHash(hash, key, value); }
public void Update(string key, IContainerItemCollection value) { var cacheKey = GetFinalKey(key); _cache.Store(StoreMode.Set, cacheKey, value, DateTime.Now.AddDays(1)); }
//TODO:添加Timeout参数 public void InsertToCache(string key, IContainerItemCollection value) { if (string.IsNullOrEmpty(key) || value == null) { return; } var cacheKey = GetFinalKey(key); //TODO:加了绝对过期时间就会立即失效(再次获取后为null),memcache低版本的bug _cache.Store(StoreMode.Set, cacheKey, value,DateTime.Now.AddDays(1)); #if DEBUG value = _cache.Get(cacheKey) as IContainerItemCollection; #endif }
public void Update(string key, IContainerItemCollection value) { _cache.HashSet(key, value.ToHashEntries()); }