Donut 缓存在 ASP.NET MVC 3 中可用吗
ASP.NET MVC 3(最终版)今天发布。当这个版本还处于起步阶段时,我记得在 codeplex 上读到正在考虑甜甜圈缓存。有谁知道这是否已经进入V3了吗?我似乎找不到任何信息,所以我只能(悲伤地)假设它没有发生。
ASP.NET MVC 3 (final) was released today. When this version was in its infancy I remember reading on codeplex that donut caching was being considered. Does anyone know if this made it into V3? I cannot seem to find any information so I can only (sadly) assume that it didn't happen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,确实如此。斯科特顾 关于它的博客:更新:
ASP.NET MVC 3 中仅支持开箱即用的甜甜圈洞缓存。这允许您通过使用
[OutputCache]
属性来缓存页面的一小部分。儿童动作。不支持允许排除已缓存页面部分的甜甜圈缓存。Response.WriteSubstitution
自 ASP.NET MVC 2 起不再工作。这是一个 好文章,它解释了 ASP.NET MVC 3 中可用的不同缓存选项。更新 2:
这是一个 很棒的文章,它说明了如何在 ASP 中启用甜甜圈缓存。 NET MVC 3.
Yes, it is. Scott Gu blogged about it:UPDATE:
Out of the box only donut hole caching is supported in ASP.NET MVC 3. This allows you to cache a small portion of the page by using the
[OutputCache]
attribute on a child action. Donut caching which allows for excluding portions of a page that has been cached is not supported.Response.WriteSubstitution
doesn't work since ASP.NET MVC 2. Here is a good article which explains the different caching options available in ASP.NET MVC 3.UPDATE 2:
Here's a great article which illustrates how donut caching could be enabled in ASP.NET MVC 3.
这是 Scott 提供的稍微更详细的详细示例,使用 Razor 语法。
Here's a slightly more detailed example from Scott, using Razor syntax.
甜甜圈缓存(是的,真正的东西)作为我的 MVC 'speed-lib' 的一部分提供:Moth。适用于 ASP.NET MVC 2 和 MVC 3。
文档位于 wiki,示例位于 Mvc3.Demo 文件夹
Donut Caching (yes, the real thing) is available as part of my 'speed-lib' for MVC: Moth. Works in both ASP.NET MVC 2 and MVC 3.
Docs are at the wiki, and examples are in the Mvc3.Demo folder
我发现 Denis Huvelle< 提到的 NuGet 包 MvcDonutCaching< /a> 解决了 3 & 的问题4 - 但我还没有测试过。
I found a NuGet package MvcDonutCaching mentioned by Denis Huvelle which solves the problem for 3 & 4 - but I haven't tested it.