System.Runtime.Caching.MemoryCache vs HttpRuntime.Cache – are there any differences?

HttpRuntime.Cache gets the Cache for the current application.

The MemoryCache class is similar to the ASP.NET Cache class.

The MemoryCache class has many properties and methods for accessing the cache that will be familiar to you if you have used the ASP.NET Cache class.

The main difference between HttpRuntime.Cache and MemoryCache is that the latter has been changed to make it usable by .NET Framework applications that are not ASP.NET applications.

For additional reading:

  • Justin Mathew Blog – Caching in .Net 4.0
  • Jon Davis Blog – Four Methods Of Simple Caching In .NET

Update :

According to the users feedback, sometimes Jon davis blog is not working.Hence I have put the whole article as an image.Please see that.

Note : If it’s not clear then just click on the image.After that it’ll open on a browser.Then click again on it to zoom 🙂

enter image description here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)