public override CacheItem AddOrGetExisting(CacheItem value, CacheItemPolicy policy) { var item = PrimaryCache.AddOrGetExisting(value, policy); //queue up writing to secondary cache on another thread ThreadPool.QueueUserWorkItem(_ => SecondaryCache.AddOrGetExisting(PrimaryCache.GetCacheItem(value.Key), policy)); return(item); }
public override object AddOrGetExisting(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null) { var item = PrimaryCache.AddOrGetExisting(key, value, absoluteExpiration, regionName); //queue up writing to secondary cache on another thread ThreadPool.QueueUserWorkItem(_ => SecondaryCache.AddOrGetExisting(key, PrimaryCache.Get(key), absoluteExpiration, regionName)); return(item); }
public override object AddOrGetExisting(string key, object value, CacheItemPolicy policy, string regionName = null) { var item = PrimaryCache.AddOrGetExisting(key, value, policy, regionName); //queue up writing to secondary cache on another thread ThreadPool.QueueUserWorkItem(_ => SecondaryCache.AddOrGetExisting(key, PrimaryCache.Get(key), policy, regionName)); return(item); }