views:

170

answers:

2

We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing.

Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.

My question is, is there a difference between action OutputCacheFilter and page output caching?

Is the action output caching faster than page output caching?

+1  A: 

Internally, the OutputCacheAttribute (aka output cache filter) uses the same internal mechanism as page output caching (aka the @OutputCache directive).

Therefore, it's not any faster than page output caching. However, with MVC, you really can't use page output caching via the @OutputCache directive in MVC because we render the view (aka page) after the action runs. So you would gain very little benefit.

With the output cache filter, it does the correct thing and does not execute the action code if the result is in the output cache. Hope that helps. :)

Haacked
+1  A: 

Just be aware that there currently is a bug if you call Html.RenderAction(..) on an Action that is marked to be cached. Instead of the specific action being cached, the entire page gets cached. I reported this on codeplex already and it seems to be a known issue: Calling <% HTML.RenderAction<...>(...); %> to an Action with [OutputCache(..)] causes entire page to cache.

Ricky