In my Web.config, under <system.web>, I have:
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="Cache60Seconds"
location="ServerAndClient"
duration="60"
varyByParam=""
/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
In the debug version of this .config, Web.Debug.config, I want the duration of the profile “Cache60Seconds” to become 0.
In other words, when I’m developing, I want “Cache60Seconds” to have a duration of 0, so it never caches, and when I release the product, I want the duration to change to 60 seconds. How do I do this?
You’re halfway there with Web Config Transformations however you should setup your Web.Config file to have your typical development environment settings (e.g., set the cache duration to 0) and the in your Web.Release.Config set the appropriate cache duration for your release environment.