Problem
- Client-side (Browser) caching of static files in dev enviornment
- Server-side (IIS Express) caching of static files in dev enviornment
Solutions
For Client-side (Browser) caching of static files in dev enviornment
- Web.Config/ApplicationHost.config Approch: Web.config Approachsuggested by @NateBarbettini above. Please note that this approach isalso can be applied to 'Applicationhost.config' instead of web.configfile.
- "Always Refresh From Server" in IE as suggested above by @Phil Degenhardt. Please find screenshot below.
- Navigate to source file location in browser address bar: Try to navigate to the JavaScript file in question by typing the address. It will show you JavaScript file contents. Once you do this, file gets updated.So you can again go back and try to navigate to proper landing page of your application. This time, you will see you get latest JavaScript code getting executed.e.g. If you have problem with not updating 'app/home/home-account.js'. Then in browser navigate to
'http://[your-host/localhost]:[specified port of your application]/app/home/home-account.js
. This will show you the contents. Then again navigate to your application's home page i.e. in this case'http://[your-host/localhost]:[specified port of your application]/'
For Server-side (IIS-Express) caching of static files in dev enviornment
visit IIS Express appcmd commandline utility. In my case, appcmd is located in "C:\Program Files(x86)\IIS Express\appcmd.exe" this path. Then use
SITE list
andSITE delete
command to remove temporary files cached in iisexpress.There is also one solution which is specific to IE mentioned here: Visual Studio 2013 caching older version of .js file