views:

308

answers:

0

--Edit--
Found duplicate myself: http://stackoverflow.com/questions/290098/aspnet-mvc-caching-vary-by-authentication

I have a page that does never change except for the "Welcome [username]" message in the master page. I had the

[OutputCache(Duration = 60, VaryByParam = "None")]

attribute on the action, but this off course caches the page even if a new user logged in. Since the user is not passed on in the query string, I'm wondering how I can let it vary by user..

--EDIT--
I found the vary by custom attribute, but I would think this usecase is something everybody has to deal with at some point. I have troubles believing this does not exist in the framework yet.

--EDIT--
Also tried Phil's donut caching solution, but my Html.Substitute never gets hit.