的OutputCache和缓存的RenderAction整个页面 [英] OutputCache and RenderAction cache whole page

查看:222
本文介绍了的OutputCache和缓存的RenderAction整个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含的ViewPage <%Html.RenderAction<&myController的GT(C => c.SidebarStats()); %GT; 。在该行动SidebarStats控制器动作我有一个OutputCache行为过滤器只缓存页面的一部分。然而,整个页面是越来越缓存,而不仅仅是采取行动。

I have a ViewPage that contains <% Html.RenderAction<MyController>(c => c.SidebarStats()); %>. On the controller action for the action SidebarStats I have an OutputCache action filter to cache only that part of the page. However, the whole page is getting cached and not just that action.

我记得看到的地方,这可能是在ASP.NET MVC中的错误,虽然我不知道。我目前使用ASP.NET MVC RC1,IIS7,Windows Server 2008和.NET 3.5 SP1。

I remember seeing somewhere that this might be a bug with ASP.NET MVC though I'm not sure. I'm currently using ASP.NET MVC RC1, IIS7, Windows Server 2008 and .NET 3.5 SP1.

推荐答案

我在博客一的解决这个问题这里。这很简单,但如果您使用的WebFormViewEngine它仅适用。我们将着眼难成搞清楚将采取什么使这项工作的所有视图引擎。

I blogged a solution to this problem here. It's simple, but it only works if you're using the WebFormViewEngine. We will look hard into figuring out what it will take to make this work for all view engines.

这篇关于的OutputCache和缓存的RenderAction整个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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