httpCacheVaryByParams values in web.config not honored

  • Updated

When you set parameter names in the web.config's <applicationSettings> node's httpCacheVaryByParams value they appear to not be honored for caching when using the MVC version of Episerver.

This setting in the web.config applies only to the Web Forms version of EpiServer, if you are using the MVC version this setting will not function. Instead you will need to use the built in ASP.Net MVC ContentOutputCache attribute at the action level in your controllers. To vary the cache by ID you would add:

[ContentOutputCache(VaryByParam="id")]

public ActionResult Index(StartPage currentPage)