For browser caching, I want to set expiration time for only one of my .js file in web.config not the whole js folder. For that I tried using the below configuration with the help of How to configure static content cache per folder and extension in IIS7? but it doesn't work:
<configuration>
<location path="compiled.js">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />
</staticContent>
</system.webServer>
</location>
</configuration>
Then I tried to change the path in "location" attribute as shown below but this also doesn't work for me:
<configuration>
<location path="~/js/compiled.js">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />
</staticContent>
</system.webServer>
</location>
</configuration>
Can someone help me how do I set cache expiration time for only one .js file instead of whole folder via web.config?