如何设置 IE 在开发/测试期间不在缓存中存储任何内容?
我正在创建一个 Asp.NET 站点并在 IE 中测试它。有时,当我更改代码并刷新页面时,更改不会被“看到”,我必须清除 IE 中的缓存和私有数据。有没有办法只为了开发而关闭浏览器端的缓存?我想要生产中的功能,但在网站上工作时它很烦人。
I'm creating an Asp.NET site and I'm testing it in IE. Sometimes when I change the code and refresh the page, the changes don't get "seen," and I have to clear the cache and private data in IE. Is there a way to turn off this caching browser-side just for development? I want the functionality there in production, but it's annoying while working on the site.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
按
Ctrl + F5
刷新页面。这会进行硬刷新并强制重新下载所有资源。 IE 开发人员工具栏还有一个选项可让您清除缓存。Press
Ctrl + F5
to refresh the page. That does a hard refresh and forces all of the resources to be downloaded again. The IE developer toolbar also has an option that lets you clear the cache.还有助于更改 IE 中的浏览历史记录设置,工具 ->选项->常规->浏览历史设置->将检查页面的新版本更改为每次访问该页面时
这将确保 IE 不会缓存任何内容并始终向服务器请求最新版本。
Also helps to change the browsing history setting in IE, Tools -> options -> General ->Browsing history settings -> change check for newer version of pages to everytime I visit the page
This will ensure that IE isn't caching anything and always asking for the latest from the server.
您可以让基页(或单个页面)执行以下操作:
检查调试模式,您可能会将应用程序置于该模式中进行开发,然后在响应级别禁用缓存。这不是 100% 的解决方案,但应该足以满足您的需求。
You could have your base page (or an individual page) that does the following:
Check for debug mode which you probably would have your app in for development and then disable caching at the response level. It's not a 100% solution but it should be enough for what you need.