How do I use VaryByParam with multiple parameters?

后端 未结 2 509
南旧
南旧 2020-12-23 20:07

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

相关标签:
2条回答
  • 2020-12-23 20:41

    You can also use * to include all parameters

     [OutputCache(Duration =9234556,VaryByParam = "*")]
    
    0 讨论(0)
  • 2020-12-23 20:55

    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.

    0 讨论(0)
提交回复
热议问题