I am creating a website on ASP.NET 4.0. I am unsure whether to use the old ASP.NET Cache class or the MemoryCache class introduced with .NET 4.0. All I can find are reasons to use MemoryCache for non-web applications, but no pros or cons when programming websites (where I obviously can use both classes).
1 Answer
I am personally a bit more thrilled about MemoryCache, as it is more flexible. But, you don't have to make a firm decision today if you abstract this out a bit so you can change implementations.
The beauty here is somone has already done the work for you here.
1 Comment
Gregory A Beamer
As an aside, I am currently working on caching implementation for a large retailer. The implementation uses both AppFabric and MemoryCache and the normal consumer is a web application (although there are windows clients, as well). I implemented something similar to the project mentioned, but the abstraction is a bit different, due to needs of the environment. This does not mean I am advocating you accept my expertise, just stating I have done work in this area.