Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations?
Asked Answered
H

2

6

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?

Huntlee answered 14/8, 2008 at 4:16 Comment(0)
A
3

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. :)

Anyone answered 14/8, 2008 at 16:32 Comment(0)
P
1

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.

Puff answered 16/8, 2008 at 13:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.