As part of IIS performance tuning in improving a website load speed, in general you want to enable browser caching by double-clicking on HTTP Response Headers in IIS Manager and check the Expire Web content: and set the After: with an x number of days.
By enabling this feature, IIS basically tells the browser to cache all static contents from the web server to the browser so on subsequent page load, the browser does not need to request all the static contents from the server as long as the cache hasn’t expired. This caching feature can also be fine-tuned for specific files or directories on the web application.
Occasionally though you want to disable the browser to cache specific files that may get updated often. For the sake of this example, we have a file myimage.png that shouldn’t be cached by the browser.
In order to do this, we can disable static file caching in web.config by having the following configuration:
<configuration> ... <location path="myimage.jpg"> <system.webServer> <staticContent> <clientCache cacheControlMode="DisableCache" /> </staticContent> </system.webServer> </location> </configuration>
As you can see from the configuration staticContent element, this method only works for static content.
Make sure after doing all this you reload the page while clearing the cache in your browser by pressing CTRL-F5 on Windows or SHIFT-COMMAND-R (⇧⌘R) on macOS.
Further Reading
How to Cache Specific Static Files and Directories on IIS
Ultra-Fast ASP.NET 4.5 (Expert’s Voice in ASP.Net)
Professional Microsoft IIS 8