清除 ie10 中的 javascript 缓存不起作用,无法再调试 javascript 更改

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17859385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 09:52:55  来源:igfitidea点击:

Clearing javascript cache in ie10 not working, can no longer debug javascript changes

javascriptinternet-explorer-10browser-cache

提问by Todd Vance

Now that I have upgraded to IE10, it's very difficult to get my javascript changed files to get recognized.

现在我已经升级到 IE10,很难让我的 javascript 更改文件被识别。

In IE9, you could simply use the 'clear the cache' button in the develepor panel and could see your javascript changes.

在 IE9 中,您可以简单地使用 develepor 面板中的“清除缓存”按钮,并可以看到您的 javascript 更改。

This no longer works (apparently) -- is there some other way to get IE10 to dump your cache? This is brutal!

这不再有效(显然)——还有其他方法可以让 IE10 转储缓存吗?这是残酷的!

On Windows 7, using VS2010 and just upgraded to IE10.

在 Windows 7 上,使用 VS2010 并且刚刚升级到 IE10。

回答by Todd Vance

I think I found out the answer... it appears that IE10 either added (or added this as a default) a setting 'PRESERVE FAVORITES WEBSITE DATA' ... this was checked (by default) and although I havent thoroughly tested it, I think this is why my js files were not being purged.

我想我找到了答案……看来 IE10 要么添加了(或将其添加为默认值)设置“保留收藏夹网站数据”……这已被检查(默认情况下),尽管我还没有对其进行彻底测试,我认为这就是为什么我的 js 文件没有被清除的原因。

enter image description here

在此处输入图片说明

回答by Halcyon

It's incredibly easy to get bugs due to bad caching. Developing with caching turned on (and manually purging the cache) is mission-impossible.

由于缓存不好而导致错误非常容易。在打开缓存(并手动清除缓存)的情况下进行开发是不可能完成的任务。

If you're using a server-side scripting language to generate your page you can use fingerprinting.

如果您使用服务器端脚本语言来生成页面,则可以使用指纹识别。

You can add a querystring to the URL that is always different, this makes it so browsers will never cache the scripts. Very useful for development, terrible for live :P

您可以向始终不同的 URL 添加一个查询字符串,这使得浏览器永远不会缓存脚本。对开发非常有用,对现场来说很糟糕:P

Eg: script.js?fingerprint=123456where 123456is a different number each page load.

例如:script.js?fingerprint=123456这里123456是不同数量的每个页面负载。

A more involved solution would look at actual changes in the source code.

更复杂的解决方案将查看源代码中的实际更改。

回答by P. Wormer

In my web-based mySQLapplication, IE-10 (with default settings) often refuses to show the presentstate of the mySQL database. It usually shows the state of an earlier visit (showing records that were deleted, or not showing records that were added).

在我的基于 web 的mySQL应用程序中,IE-10(具有默认设置)经常拒绝显示mySQL 数据库的当前状态。它通常显示较早访问的状态(显示已删除的记录,或不显示已添加的记录)。

This is a consequence of a changeable IE-10 setting. (Unfortunately I have only access to a Dutch-speaking IE-10, MS refuses me to download an English speaking browser). In rough translation: go to Internet options/General. You see "Browsing History" with a button "Settings". Hit it and you will see radio buttons determining the search for fresh pages. The default is "automatic", change it to "search for fresh page on every visit". This fixed my problem

这是 IE-10 设置可变的结果。(不幸的是,我只能访问讲荷兰语的 IE-10,MS 拒绝我下载讲英语的浏览器)。粗略翻译:转到 Internet 选项/常规。您可以通过“设置”按钮看到“浏览历史记录”。点击它,您将看到确定搜索新页面的单选按钮。默认为“自动”,将其更改为“每次访问时搜索新页面”。这解决了我的问题

Unfortunately however, I don't know how to set this from within my app, so I have to inform my users about it. This is awkward.

然而不幸的是,我不知道如何在我的应用程序中设置它,所以我必须通知我的用户。这很尴尬。