The corresponding configuration in Web.config is as follows:
Copy Code code as follows:
<configuration>
<system.webServer>
<caching>
<profiles>
<add extension= ". css" policy= "Cacheuntilchange" kernelcachepolicy= "Cacheuntilchange" duration= "00:00:30"/>
<add extension= ". js" policy= "Cacheuntilchange" kernelcachepolicy= "Cacheuntilchange" duration= "00:00:30"/>
</profiles>
</caching>
</system.webServer>
</configuration>
Effects seen in the browser:
Workaround:
1, disable User-mode caching, only use Kernel-mode caching.
2. Add cachecontrolcustom= "public" in Web.config
Copy Code code as follows:
<configuration>
<system.webServer>
<staticContent>
<clientcache cachecontrolcustom= "public" cachecontrolmode= "Usemaxage" cachecontrolmaxage= "300.00:00:00"/>
</staticContent>
<caching>
<profiles>
<add extension= ". css" policy= "Dontcache" kernelcachepolicy= "Cacheuntilchange" duration= "30:00:30"/>
<add extension= ". js" policy= "Dontcache" kernelcachepolicy= "Cacheuntilchange" duration= "30:00:30"/>
</profiles>
</caching>
</system.webServer>
</configuration>