donut-caching

How do I 'donut cache' in ASP.NET MVC for something more than a date

末鹿安然 提交于 2020-01-02 04:33:43
问题 All the examples for donut caching I've seen are just like this : <%= Html.Substitute( c => DateTime.Now.ToString() )%> Thats fine if I just want the date, but what other options are there? I know there is a delegate 'MvcSubstitutionCallback' which has the following signature : public delegate string MvcSubstitutionCallback(HttpContextBase httpContext); but RenderAction and RenderPartial returns void so i cant just return them from the delegate method. How can I effectively use this callback

Donut hole caching - exclude MiniProfiler.RenderIncludes

百般思念 提交于 2019-12-23 09:39:09
问题 I have an ASP.NET MVC action that is decorated with the OutputCache attribute, but the problem is that the MiniProfiler output is cached as well. I'd like to exclude the MiniProfiler output from the caching (donut hole), but I'm not sure how I can exclude a call like MiniProfiler.RenderIncludes(). Anyone who happen to know how I can do this? 回答1: This is an important point if using MiniProfiler in production. As if the first visit to a page is by a user where MiniProfiler is enabled, all

Is Donut caching available in ASP.NET MVC 3

瘦欲@ 提交于 2019-12-17 16:10:50
问题 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. 回答1: Yes, it is. Scott Gu blogged about it: 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

MVCDonutCaching - Issues with child action when parent is not donut cached

99封情书 提交于 2019-12-10 17:11:09
问题 I am using the awesom MVCDonutCaching package from Nuget in order to cache entire pages while leaving certain portions uncached. The process is simple and everything works as it should: I am caching as follows: [DonutOutputCache(CacheProfile = "FiveMins")] public ActionResult Index() { return View(); } For the section of my page I do not wish to cache I am doing the following: @Html.Action("HeaderLinks","Home", true) This works as it should and indeed the bulk of the page is cached but my

How do I 'donut cache' in ASP.NET MVC for something more than a date

拈花ヽ惹草 提交于 2019-12-05 10:25:14
All the examples for donut caching I've seen are just like this : <%= Html.Substitute( c => DateTime.Now.ToString() )%> Thats fine if I just want the date, but what other options are there? I know there is a delegate 'MvcSubstitutionCallback' which has the following signature : public delegate string MvcSubstitutionCallback(HttpContextBase httpContext); but RenderAction and RenderPartial returns void so i cant just return them from the delegate method. How can I effectively use this callback for more complex situations. I've looked at both of Phil Haacked's articles here and here , but neither

Can I use [CompressFilter] in ASP.NET MVC without breaking donut caching

会有一股神秘感。 提交于 2019-12-04 08:18:20
问题 I am trying to get [CompressFilter] working with donut caching and running into issues. What happens is that the whole page gets cached and not just the donut. The source for the CompressFilter I am using is below. I changed this from the original source to use OnResultExecuted instead of OnActionExecuting() because I needed access to the type of the result to avoid caching certain ActionResult subclasses. Looking at the actual MVC v1 source code for OutputCacheAttribute it looks like it also

Can I use [CompressFilter] in ASP.NET MVC without breaking donut caching

ⅰ亾dé卋堺 提交于 2019-12-02 21:00:42
I am trying to get [ CompressFilter ] working with donut caching and running into issues. What happens is that the whole page gets cached and not just the donut. The source for the CompressFilter I am using is below. I changed this from the original source to use OnResultExecuted instead of OnActionExecuting() because I needed access to the type of the result to avoid caching certain ActionResult subclasses. Looking at the actual MVC v1 source code for OutputCacheAttribute it looks like it also is using OnResultExecuted() , but I dont think that fact directly is causing the conflict. I don't

How to use ASP.Net server controls inside of Substitution control?

▼魔方 西西 提交于 2019-11-29 07:40:14
while the method we use in Substitution control should return strings, so how is it possible to use a donut caching in web forms on a server control which should be rendered server side? for example Loginview control? Micah UPDATE This is now a fully working example. There a few things happening here: Use the call back of a substitution control to render the output of the usercontrol you need. Use a custom page class that overrides the VerifyRenderingInServerForm and EnableEventValidation to load the control in order to prevent errors from being thrown when the usercontrol contains server

How to use ASP.Net server controls inside of Substitution control?

无人久伴 提交于 2019-11-28 01:14:13
问题 while the method we use in Substitution control should return strings, so how is it possible to use a donut caching in web forms on a server control which should be rendered server side? for example Loginview control? 回答1: UPDATE This is now a fully working example. There a few things happening here: Use the call back of a substitution control to render the output of the usercontrol you need. Use a custom page class that overrides the VerifyRenderingInServerForm and EnableEventValidation to

Is Donut caching available in ASP.NET MVC 3

折月煮酒 提交于 2019-11-27 21:27:51
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. Yes, it is. Scott Gu blogged about it : 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