/// <summary> /// 移除缓存,根据缓存键 /// </summary> /// <param name="cacheKey">缓存键</param> public void Remove(string cacheKey) { Check.NotNullOrEmpty(cacheKey, nameof(cacheKey)); WriteLog($"Remove : cacheKey = {cacheKey}"); _memcachedClient.Remove(this.HandleCacheKey(cacheKey)); }
public void Remove(string key) { _client.Remove(key); if (Keys.Contains(key)) { SyncKeys(Keys.Where(_ => _ != key).ToHashSet <string>()); } }
public ulong DecrementMyCounter(string reportName, ILambdaContext context) { ulong index = memcachedClient.Decrement($"{reportName}_GP_Count", 0, 1, this.expiration); context.Logger.Log($"DecrementMyCounter {index}"); if (index == 0) { context.Logger.Log($"DecrementMyCounter Removed index == 0"); memcachedClient.Remove($"{reportName}_GP_Count"); } return(index); }
public void Purge <TResult>(Expression <Func <T, TResult> > expression) { var methodInfo = SymbolExtensions.GetMethodInfo(expression); var parameters = SymbolExtensions.GetParameter(expression); var proxyExpression = new ProxyRequest <T, TResult>(methodInfo, parameters); var hash = proxyExpression.CreateHash(); _client.Remove(hash); }
public void InvalidateCacheItem(string cacheKey) { try { var sanitisedKey = SanitiseCacheKey(cacheKey); var success = _client.Remove(sanitisedKey); if (!success) { _logger.WriteErrorMessage(string.Format("Unable to remove item from cache. CacheKey:{0}", sanitisedKey)); } } catch (Exception ex) { _logger.WriteException(ex); } }
public void DestroyAccessToken() { string hash; if (TryGetHashFromCookie(out hash)) { _logger.Info("Destroying session: " + hash); _memcachedClient.Remove(hash); HttpContext.Current.Items.Remove(typeof(UserAccessToken)); var cookie = new HttpCookie(_cookieName, "expired") { Secure = _useSecureCookie, /* Ensures that this cookie is only used on SSL connections - this prevents Man-in-the-middle attacks */ HttpOnly = true, /* Ensures that the cookie cannot be read from JavaScript - this prevents XSS attacks */ Expires = DateTime.Now.AddYears(-1) }; HttpContext.Current.Response.Cookies.Add(cookie); } }
/// <summary> /// Remove the specified cacheKey. /// </summary> /// <returns>The remove.</returns> /// <param name="cacheKey">Cache key.</param> public void Remove(string cacheKey) { ArgumentCheck.NotNullOrWhiteSpace(cacheKey, nameof(cacheKey)); _memcachedClient.Remove(this.HandleCacheKey(cacheKey)); }
public static void Remove(IMemcachedClient client, string id) { client.Remove(DataPrefix + id); client.Remove(HeaderPrefix + id); }
public bool Remove(string key) { return(mc.Remove(key)); }
public virtual void Remove <T>(string key) { memcachedClient.Remove(key); }
public override void Remove(string key) { _client.Remove(key); }
public static void Remove(IMemcachedClient client, string id) { //lock (padLock) //{ client.Remove(DataPrefix + id); client.Remove(HeaderPrefix + id); //} }
public void Remove(string key) { _client.Remove(key); }
public bool Remove(string key) { return(_client.Remove(key)); }
public void Remove(string key) { cache.Remove(key); }
public static bool Remove(string key) { return(Cache.Remove(key)); }
public void Delete(string id) { _client.Remove(GetKey(id)); }
public void RemoveItem(System.Web.HttpContext context, string id, object lockId) { client.Remove(id); }
public bool Remove(string key) { return(_memcachedClient.Remove(key)); }
/// <summary> /// Function to remove an item from the output cache /// </summary> /// <param name="key">The unique identifier for the entry to remove from the output cache</param> public override void Remove( string key) { client.Remove(SanitizeKey(key)); }
public void Remove_Should_Fail() { Assert.False(client.Remove(GetUniqueKey())); }
public void Remove(string key) { IMemcachedClient client = this.GetMemcachedClient(); client.Remove(key); }