JS file not updating when testing ASP.NET MVC application with VS2008

I have an MVC application developed in VS2008.

When I run the application, the changes made to the JS file are not updated.

Server problem (IE7) or VS2008 dev server

If I use Firefox, is it updated?

Malcolm

+2


source to share


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


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







All Articles