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
3 Answers
Reset to default 3You 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.
本文标签:
版权声明:本文标题:Why does Internet Explorer (or other browsers) use old JavaScript files when I try to debug my ASP.NET program? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745225987a2648609.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论