tags:

views:

83

answers:

3

ASP.NET Offers great caching api with lots of functionality. Can anybody answer me that how i can use the caching api with the asp.net mvc.

+1  A: 

Steven A. Smith has a very good article about cache. This was written back in 2003, but most of them still apply today.

There is a section in the article called "Caching API, Using the Cache Object".

J.W.
+3  A: 

Not sure if you've seen this already, but you might want to take a look at the OutputCache attribute. You can use this attribute on the actions in your controllers.. this allows you to cache the action's output.

There is some info on this page of Scott Gu's blog (the section titled 'OutputCache Filter') : http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4-release-part-1.aspx

markt
+1  A: 

There's an introduction to ASP.NET 2.0's caching mechanism here.

ASP.NET MVC basically relies on this, and adds Cache Attributes. The use of the Cache functionality of ASP.NET Web Forms is a bit problematic. Also check this link.

Also, remember that ASP.NET's cache will not work in a distributed environment. It's basically designed for single-server applications.

There is Microsoft's Velocity project and for instance, or Memcached, which is used by sites like LiveJournal.

kitsune