11

我在测试站点上使用 mvc-mini-profiler。当我在我的操作方法上放置一个 OutputCacheAttribute 时,探查器没有被执行并且总是返回他在缓存之前的最后一个值。

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

http://localhost/Home (from cache) 2.1ms,  +0.5ms 
4

1 回答 1

1

Applying output caching to a controller action also caches the profiler results. When OutputCache is applied to a controller most of the ASP.NET MVC pipeline is not executed.

You could add the date-time information of when the page was generated to the profiler, something like:

profiler.Step("Generated: " + DateTime.Now.ToString());
于 2013-05-22T20:45:19.680 回答