简体   繁体   English

当我尝试调试ASP.NET程序时,为什么Internet Explorer(或其他浏览器)使用旧的JavaScript文件?

[英]Why does Internet Explorer (or other browsers) use old JavaScript files when I try to debug my ASP.NET program?

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 ). 我正在更改ASP.NET MVC 5解决方案中的.js JavaScript文件,但是当我调试程序时,Internet Explorer 11经常加载旧的JavaScript文件(Chrome也这样做)。 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? 即使它的缓存中有缓存的JavaScript文件,它也不应该以新的修改日期加载新的JavaScript文件吗?

You can either read http://fiddler2.com/r/?httpperf to learn how browsers implement caching, or you can simply hit CTRL+F5 to get IE to bypass the cache. 您可以阅读http://fiddler2.com/r/?httpperf来了解浏览器如何实现缓存,也可以直接按CTRL + F5来使IE绕过缓存。

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. IE不能神奇地“知道”服务器是否有更新的版本而不要求它,这将首先破坏了具有缓存的目的。

change the setting via tools ->Internet options -> advanced -> enable the option empty internet temporary files folder when browser is closed 通过工具更改设置-> Internet选项->高级->在关闭浏览器时启用选项Internet临时文件文件夹为空

This worked for me 这对我有用

在资源管理器设置中,将属性设置为在您每次访问页面时获取文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么字符在 Internet Explorer 中“未定义”,而在其他浏览器中却没有 - Why characters are 'undefined' in internet explorer but not in other browsers jQuery无法在Internet Explorer中像在其他浏览器中一样工作 - jQuery not working in Internet Explorer as it does in other browsers JavaScript function 仅适用于 Internet Explorer(在 ASP.NET WebForms 中) - JavaScript function works only in Internet Explorer (in ASP.NET WebForms) 如何在ASP.NET和JAVASCRIPT中最小化和最大化Internet Explorer? - How to minimize and maximize internet explorer in ASP.NET and JAVASCRIPT? 为什么我在asp.net到Z78E6221F6393D1356681DB398F14CE2EF2919ZFFEEE708代码中使用Response.Write()方法时页面中的css样式发生变化? - Why does the css style in the page change when I use the Response.Write() method in asp.net to output the javascript code? 尝试刷新usestate时为什么程序会中断? - Why does my program break when I try to refresh the usestate? 为什么Internet Explorer和Edge与其他浏览器将新的Date()数据输出到数据库不同? - Why does Internet Explorer and Edge output new Date() data into database differently than other browsers? 为什么我的JavaScript函数在Internet Explorer中不起作用 - Why does my javascript function not work in Internet explorer 如何使该texarea javascript在Internet Explorer以外的其他浏览器中工作 - how to make this texarea javascript work in other browsers except Internet Explorer 此代码在使用 Internet Explorer 打开时工作正常,但在我使用 firefox 或其他浏览器打开时无法工作 - This code works fine when opened with internet explorer but fails to work when i open it with firefox or other browsers
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM