带有OutputCacheAttribute的mvc-mini-profiler

Ale*_*bin 11 outputcache asp.net-mvc-3 mvc-mini-profiler

我在测试网站上使用mvc-mini-profiler.当我在我的action方法上放置一个OutputCacheAttribute时,不会执行探查器并始终返回缓存之前的最后一个值.

有没有办法告诉mvc-mini-profiler结果来自缓存,以便它可以更新他的状态?也许在客户端网站上,我们可以看到这样的信息:

http://localhost/Home (from cache) 2.1ms,  +0.5ms 
Run Code Online (Sandbox Code Playgroud)

jor*_*ebg 1

将输出缓存应用于控制器操作还会缓存探查器结果。当 OutputCache 应用于控制器时,大多数 ASP.NET MVC 管道都不会执行。

您可以将生成页面的日期时间信息添加到探查器中,例如:

profiler.Step("Generated: " + DateTime.Now.ToString());
Run Code Online (Sandbox Code Playgroud)