admin管理员组

文章数量:1415420

I'm changing a .js JavaScript file in my ASP.NET MVC 5 solution, but when I go to debug the program, Internet Explorer 11 frequently loads old JavaScript files (caught chrome doing it too ). What is the problem here, some setting I'm missing? Even if it has the cached JavaScript file in its cache, shouldn't it load the new one with the newer modified date?

I'm changing a .js JavaScript file in my ASP.NET MVC 5 solution, but when I go to debug the program, Internet Explorer 11 frequently loads old JavaScript files (caught chrome doing it too ). What is the problem here, some setting I'm missing? Even if it has the cached JavaScript file in its cache, shouldn't it load the new one with the newer modified date?

Share Improve this question edited Jan 17, 2016 at 17:42 Isaac Bolinger asked Mar 11, 2014 at 21:25 Isaac BolingerIsaac Bolinger 7,39811 gold badges56 silver badges92 bronze badges 8
  • Dynamically add something like file.js?v=00013 to your paths to simply avoid the problem. – Etheryte Commented Mar 11, 2014 at 21:27
  • 3 We should all sign a petition to ban IE from the face of the earth. It is always a nightmare to work with. :) – Sumner Evans Commented Mar 11, 2014 at 21:28
  • 3 'Even if it has the cached javascript file in its cache, shouldn't it load the new one with the newer modified date?' I don't think so. It will live in the cache as long as the server told it to keep it there with the Expires HTTP Response header. From there it wouldn't bother checking to see if there is a newer copy because it already has one. – Rich Commented Mar 11, 2014 at 21:28
  • 3 Try clearing the cache by using Ctrl + F5 in the browser when you refresh the page. – DOK Commented Mar 11, 2014 at 21:29
  • 1 Whenever facing such issues with a browser, try opening the same link in a fresh private browsing session for the same browser. If the old file is still served, then problem is on server side, else it is the client (the browser) which is playing some caching mischief. – Anshul Goyal Commented Mar 11, 2014 at 21:31
 |  Show 3 more ments

3 Answers 3

Reset to default 3

You can either read http://fiddler2./r/?httpperf to learn how browsers implement caching, or you can simply hit CTRL+F5 to get IE to bypass the cache.

IE cannot magically "know" that the server has a newer version without asking for it, which would defeat the purpose of having a cache in the first place.

change the setting via tools ->Internet options -> advanced -> enable the option empty internet temporary files folder when browser is closed

This worked for me

In explorer settings set the property to get files every time you visit the page.

本文标签: