Example #1
0
        public override void Set(CacheItem item, CacheItemPolicy policy)
        {
            PrimaryCache.Set(item, policy);

            //queue up writing to secondary cache on another thread
            ThreadPool.QueueUserWorkItem(_ => SecondaryCache.Set(PrimaryCache.GetCacheItem(item.Key, item.RegionName), policy));
        }
Example #2
0
        public override void Set(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null)
        {
            PrimaryCache.Set(key, value, absoluteExpiration, regionName);

            //queue up writing to secondary cache on another thread
            ThreadPool.QueueUserWorkItem(_ => SecondaryCache.Set(key, PrimaryCache.Get(key), absoluteExpiration, regionName));
        }
Example #3
0
        public override void Set(string key, object value, CacheItemPolicy policy, string regionName = null)
        {
            PrimaryCache.Set(key, value, policy, regionName);

            //queue up writing to secondary cache on another thread
            ThreadPool.QueueUserWorkItem(_ => SecondaryCache.Set(key, PrimaryCache.Get(key), policy, regionName));
        }