我怎样才能在asp.net mvc中使用缓存api?

时间:2023-02-02 04:14:37

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.

ASP.NET提供了很多功能强大的缓存API。任何人都可以回答我如何使用asp.net mvc的缓存api。

3 个解决方案

#1


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.

不确定您是否已经看过这个,但是您可能想看一下OutputCache属性。您可以在控制器中的操作上使用此属性。这允许您缓存操作的输出。

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

Scott Gu的博客(标题为“OutputCache Filter”)的这一页有一些信息:http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4 - 释放 - 部分 - 1.aspx

#2


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

Steven A. Smith有一篇关于缓存的非常好的文章。这是在2003年写的,但其中大部分仍然适用于今天。

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

文章中有一节名为“缓存API,使用缓存对象”。

#3


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

这里介绍了ASP.NET 2.0的缓存机制。

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.

ASP.NET MVC基本上依赖于此,并添加了缓存属性。使用ASP.NET Web窗体的缓存功能有点问题。另请查看此链接。

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

另外,请记住,ASP.NET的缓存在分布式环境中不起作用。它基本上是为单服务器应用程序设计的。

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

有微软的V​​elocity项目,例如Livecournal等网站使用的Memcached。

#1


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.

不确定您是否已经看过这个,但是您可能想看一下OutputCache属性。您可以在控制器中的操作上使用此属性。这允许您缓存操作的输出。

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

Scott Gu的博客(标题为“OutputCache Filter”)的这一页有一些信息:http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4 - 释放 - 部分 - 1.aspx

#2


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

Steven A. Smith有一篇关于缓存的非常好的文章。这是在2003年写的,但其中大部分仍然适用于今天。

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

文章中有一节名为“缓存API,使用缓存对象”。

#3


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

这里介绍了ASP.NET 2.0的缓存机制。

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.

ASP.NET MVC基本上依赖于此,并添加了缓存属性。使用ASP.NET Web窗体的缓存功能有点问题。另请查看此链接。

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

另外,请记住,ASP.NET的缓存在分布式环境中不起作用。它基本上是为单服务器应用程序设计的。

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

有微软的V​​elocity项目,例如Livecournal等网站使用的Memcached。