Html 浏览器不反映代码中的更新
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1193093/
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
Browsers does not reflects updates in the code
提问by thatryan
While working on HTML I and testing offline, you know changing the code and refreshing the browser, nothing is happening anymore.
在处理 HTML I 和离线测试时,您知道更改代码和刷新浏览器,什么也没有发生。
Both Firefox and Safari seem to not care about refreshing to reflect the changes. But Opera does.
Firefox 和 Safari 似乎都不关心刷新以反映更改。但歌剧做到了。
Even if I upload the new file to the server and refresh in FF it is not showing the new code styles, I have emptied cookies. I am confused; any ideas?
即使我将新文件上传到服务器并在 FF 中刷新它也没有显示新的代码样式,我已经清空了 cookie。我很迷惑; 有任何想法吗?
回答by Randell
Maybe you're modifying a different file. It happens.
也许您正在修改不同的文件。它发生了。
回答by Andreas Grech
Try refreshing with CTRL+ F5
尝试用CTRL+刷新F5
That will empty the browser's cache and refresh the page.
这将清空浏览器的缓存并刷新页面。
回答by Cide
The easiest way to get around this is to press ctrl+ror ctrl+F5. The ctrl modifier (supported by most/all modern browsers) forces a full reload of the page.
解决此问题的最简单方法是按ctrl+r或ctrl+ F5。ctrl 修饰符(大多数/所有现代浏览器都支持)强制完全重新加载页面。
回答by Dan Diplo
Are you going through a proxy server? Often these can cache files.
你是通过代理服务器吗?通常这些可以缓存文件。
Otherwise, check browser settings:
否则,请检查浏览器设置:
In IE7 go to Tools > General > Browsing History Settings and select 'Everytime' for the 'Check for new pages' option.
在 IE7 中,转到“工具”>“常规”>“浏览历史记录设置”并为“检查新页面”选项选择“每次”。
回答by AutomatedTester
When using Firefox I would install the Web Developer extension https://addons.mozilla.org/en-US/firefox/addon/60which is a really good tool for forcing cache to empty.
使用 Firefox 时,我会安装 Web Developer 扩展https://addons.mozilla.org/en-US/firefox/addon/60,这是一个非常好的强制缓存清空工具。
回答by Justin Johnson
Or shift+click on the refresh button
或者shift+点击刷新按钮
回答by alhockly
Ctrl+F5 should properly refresh the page This also works for python eel library not updating refreshing straight away after changes
Ctrl+F5 应该正确刷新页面这也适用于 python eel 库在更改后不会立即更新刷新
回答by Everett Staley
I know this is a very old topic, but Firefox still fails to show code changes after refreshing a page, then viewing the page source. What works for me is when I "View Page Source" in Firefox, I then refresh the newly-opened tab which contains the page source.
我知道这是一个非常古老的话题,但是在刷新页面,然后查看页面源代码后,Firefox 仍然无法显示代码更改。对我有用的是当我在 Firefox 中“查看页面源代码”时,然后刷新包含页面源代码的新打开的选项卡。
回答by Aaron Digulla
Make sure your server is sending the correct caching information for the file. If it doesn't tell the browser correctly that the file is outdated, the browsers won't download it again.
确保您的服务器正在发送文件的正确缓存信息。如果它没有正确地告诉浏览器文件已过时,浏览器将不会再次下载它。
See https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-cachingfor a good overview.
请参阅https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching以获得一个很好的概述。
回答by aravinth_2442
Yes. That's because of the browser cache. Better clear the cache and refresh the page. I use a private window or icognito as in Chrome so its not cached. Make the change and refresh the page. Your changes should have been reflected.
是的。那是因为浏览器缓存。最好清除缓存并刷新页面。我在 Chrome 中使用私人窗口或 icognito,所以它没有被缓存。进行更改并刷新页面。您的更改应该已得到反映。