For every other MVC project I have, I can edit my javascript, go to the browser, hit refresh and see my changes. But for this one project, my localhost server seems to be hanging on to the old files. I have verified this by hitting the script in question
directly from 3 different browsers (two of which had never loaded the previous version of the javascript), and in all 3 I see the previous version of the javascript.
Can anyone illuminate me as to why this is happening and how to prevent my javascript (or any files) from being cached on localhost? My coworker seems to have this problem with this project as well (we share the code through TFS). I have googled the problem
pretty hard, but found nobody with a similar issue.
We are using VS21010 professional. .Net Framework version 4.0.30319 SP1Rel.
planet idiot
Member
57 Points
30 Posts
deleteme
Aug 03, 2012 02:40 PM|LINK
For every other MVC project I have, I can edit my javascript, go to the browser, hit refresh and see my changes. But for this one project, my localhost server seems to be hanging on to the old files. I have verified this by hitting the script in question directly from 3 different browsers (two of which had never loaded the previous version of the javascript), and in all 3 I see the previous version of the javascript.
Can anyone illuminate me as to why this is happening and how to prevent my javascript (or any files) from being cached on localhost? My coworker seems to have this problem with this project as well (we share the code through TFS). I have googled the problem pretty hard, but found nobody with a similar issue.
We are using VS21010 professional. .Net Framework version 4.0.30319 SP1Rel.
Thanks!
robbygregory
Member
170 Points
30 Posts
Re: deleteme
Aug 03, 2012 03:03 PM|LINK
That seems odd that it works in some projects and not others...
Try going to Tools -> Options -> Debugging -> Just-In-Time and make sure that all three checkboxes are checked.
You may also want to poke around in the other Debugging options as well, tehre are some useful features in there.
bruce (sqlwo...
All-Star
36836 Points
5443 Posts
Re: deleteme
Aug 03, 2012 03:24 PM|LINK
usually when you include javascript, you include a build number:
<script src="myscript.js?b=4545">
or a version number
<script src="myscript.1.2.js">
this allows caching, but always return the current version