Jpsy
Jpsy

Reputation: 20892

ASP.NET Cache class vs. MemoryCache class

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).

Upvotes: 8

Views: 3060

Answers (1)

Gregory A Beamer
Gregory A Beamer

Reputation: 17010

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.

Upvotes: 3

Related Questions