I do some web development for work and the biggest hit to my productivity comes from IIS. It caches files that will not update even when they are changed, unless I restart IIS. Specifically, I am referring to html, js, and css files. This problem forces me to stop and start my web application constantly. Since I have Windows 7 I believe I have ISS 7.5. I am using IIS Express. This is so frustrating that I'd prefer IIS to never cache anything, ever. I am fine with a solution that stops all forms of caching or just for the project I am working on.
IIS Manager is not available to me. It is not located in System and Security -> Administrative Tools -> IIS Manager like is suggested by https://technet.microsoft.com/en-us/library/cc770472%28v=ws.10%29.aspx. Also, searching for inetmgr in the Start Search box gets me no results. Because of this, I am looking for a fix to the IIS applicationhost.config file.
I have tried putting the following in my applicationhost.config which doesn't work:
<location path="ProjectName">
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="DisableCache" />
</staticContent>
<caching enabled="false" enableKernelCache="false"></caching>
</system.webServer>
</location>
The closest question on StackOverflow to my problem was IIS cached files never replaced. However, Fiddler shows me that the old files are being sent to the browser even after they have been changed.
How can IIS to send my browser the updated files without having to restart it?
I suspect that you have enabled output caching, this would exhibit the behaviour that you are describing where recycling the app pool or restarting IIS clears them and allows you to see the new content.
This page gives more information, http://www.iis.net/learn/manage/managing-performance-settings/walkthrough-iis-output-caching
If you are using IIS Express then it is likely that the caching is set at the application level in your web.config, or on individual pages.
You need to set
or if its IIS 7+ (Which IIS Express will be)
Quite possible it's the browser which is the culprit. Have you tried ctrl+ F5 ?
If anyone stumbles upon this and wants a "mouse click" way of disabling cache in IIS 7 or so... here's an answer from IIS forums on https://forums.iis.net/t/959070.aspx :
You get a setting in web.config file something like this:
So, no tag here..