What is difference between .NET framework 4.0 MemoryCache vs ObjectCache?
Where to use which object?
From MSDN;
The ObjectCache type is the primary type for the in-memory object cache. The built-in MemoryCache class derives from the ObjectCache class. The MemoryCache class is the only concrete object cache implementation in the .NET Framework 4 that derives from the ObjectCache class.
public class MemoryCache : ObjectCache,
IEnumerable, IDisposable
MemoryCache inherits from ObjectCache.
You can get a reference to the default MemoryCache instance like this;
public static ObjectCache cache = MemoryCache.Default;