views:

36

answers:

2

Hi,

I have a MVC app developed in VS2008.

When I run the app the changes I made to a JS file are not being updated.

Is this the browser problem (IE7) or VS2008 dev server problem??

If I use Firefox it is updated?

Malcolm

A: 

I have the same problem. When I make changes to a JS file, my only solution is to to a full 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 do not have this problem with a real IIS7 server on any browser.

Jarrett Meyer
A: 

Probably the browser. Here's the trick I use, (and StackOverflow uses). In your HTML files, put a version number in the query string for your JS files like so:

<link href="foo.js?version=somethingthatchanges" />

This will cause the browser to go back to the server each time you update your app to get a new JS file. You can either hard-code an increasing number here in the query string, or you can put in your .NET assembly version info there if you want.

Dave Markle
You did not finish typing how to do this???
Malcolm
D'oh. Sorry. I forgot to mark my example as "code" and StackOverflow hides tags unless they're in "code" blocks.
Dave Markle