using System.Runtime.Caching; namespace iiie.CacheControl.Business.OutputCache { public class MemoryOutputCache : IOutputCache { private static readonly MemoryCache Cache = MemoryCache.Default; public override object Get(string key) { return Cache.Get(key); } public override void Remove(string key) { lock (Cache) { Cache.Remove(key); } } public override bool Contains(string key) { return Cache.Contains(key); } public override void Add(string key, object o) { lock (Cache) { Cache.Add(key, o, new CacheItemPolicy()); } } } }