In ASP.NET MVC2 I use OutputCache
and the VaryByParam
attribute. I got it working fine with a single parameter, but what is the correct syntax when
You can also use *
to include all parameters
[OutputCache(Duration =9234556,VaryByParam = "*")]
You can use * for all parameters or a semi-colon separated list (VaryByParam = "customerId;languageId"
).
You can also use none if you didn't want it to cache different versions....
Here's a nice write up specifically for MVC.