ASP.NET MVC 3 中是否提供甜甜圈缓存 [英] Is Donut caching available in ASP.NET MVC 3

查看:29
本文介绍了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.

推荐答案

是的,是的.Scott Gu 在博客上写过:

除了支持整页输出缓存,ASP.NET MVC 3 也支持部分页面缓存——允许您缓存输出区域并在多个请求中重用它或控制器.[输出缓存]部分页面缓存的行为是用 RC2 更新,以便子内容缓存的条目基于输入参数而不是 URL顶级请求的结构——这使得缓存场景更容易和更强大先前 RC 中的行为.

In addition to supporting full page output caching, ASP.NET MVC 3 also supports partial-page caching – which allows you to cache a region of output and re-use it across multiple requests or controllers. The [OutputCache] behavior for partial-page caching was updated with RC2 so that sub-content cached entries are varied based on input parameters as opposed to the URL structure of the top-level request – which makes caching scenarios both easier and more powerful than the behavior in the previous RC.

<小时>

更新:

在 ASP.NET MVC 3 中仅支持开箱即用的圆环孔缓存.这允许您通过在子操作上使用 [OutputCache] 属性来缓存页面的一小部分.不支持允许排除已缓存页面部分的甜甜圈缓存.Response.WriteSubstitution 自 ASP.NET MVC 2 起不起作用.这是一个 好文章,解释了 ASP.NET MVC 3 中可用的不同缓存选项.

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.

更新 2:

这是一篇很棒的文章 说明了如何在 ASP.NET MVC 3 中启用甜甜圈缓存.

Here's a great article which illustrates how donut caching could be enabled in ASP.NET MVC 3.

这篇关于ASP.NET MVC 3 中是否提供甜甜圈缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆