JS file not updating when testing ASP.NET MVC application with VS2008
2 answers
I have the same problem. When I make changes to the JS file, my only solution is to completely refresh (CTRL-F5) to see the JS changes. My guess is that the VS development server is not smart enough to handle static file caching.
I have no problem with a real IIS7 server in any browser.
+2
source to share
Perhaps a browser. Here is the trick I am using (and is using StackOverflow). In your HTML files, put the version number in the query string for your JS files like this:
<link href="foo.js?version=somethingthatchanges" />
This will make the browser go back to the server every time you update the application to get a new JS file. You can either hard-code the incrementing number here in the query string, or you can add a .NET assembly version to your assembly there if you like.
+1
source to share