Вам необходимо использовать CacheProfile
:
[OutputCache(CacheProfile = "CacheProfile1")]
public ActionResult GetProducts(int id, string template, string version)
web.config:
<system.web>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="CacheProfile1" duration="0" varyByParam="*" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
</system.web>
Преобразование в web.Release.config:
<system.web>
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="CacheProfile1" duration="43200" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
</system.web>
При публикации в режиме релиза он выдаст это для web.config:
<add name="CacheProfile1" duration="43200" varyByParam="*" />