如何在InternetExplorer 8中禁用缓存

时间:2022-08-24 11:09:22

How can I disable cache in IE8 ? We are doing Javascript development and testing it in IE8, but we have to clear the cache every time we make changes to the Javascript files.

如何在IE8中禁用缓存?我们正在进行Javascript开发并在IE8中进行测试,但是每次修改Javascript文件时都必须清除缓存。

10 个解决方案

#1


67  

Go to Internet Options. On the General tab, under Browsing History click Settings. Select the "Every time I visit the webpage" radio button.

去网络选项。在“常规”选项卡上,在“浏览历史”下单击“设置”。选择“每次访问网页”单选按钮。

This doesn't "disable" the cache per se, but it should fix your underlying problem - the JS files should be reloaded every time.

这并不“禁用”缓存本身,但它应该修复底层的问题——JS文件应该每次都重新加载。

#2


16  

Ctrl+F5 Should cause a full page refresh including all that cached javascript.

Ctrl+F5应该会导致整个页面的刷新,包括所有缓存的javascript。

Occasionally though, you'll still need a cache clear, because even Ctrl+F5 won't work, for reasons beyond comprehension IE can't even get "refresh" right 100% of the time.

有时候,你仍然需要一个缓存清除,因为即使是Ctrl+F5也不能工作,原因是无法理解的,IE在100%的时候都不能得到“刷新”。

#3


11  

If that fails, a random parameter on the query string will do it:

如果失败,查询字符串上的随机参数将执行此操作:

index.html?a=346456

index . html ? = 346456

#4


10  

Load you JavaScript this way.

以这种方式加载JavaScript。

<html>
...
<script type="text/javascript">
document.write('<script src="yourscript.js?'+Math.random()+'"></script>');
</script>
...
</html>

Edit: In case this is not obvious, remove this code as soon you will go into production!

编辑:如果这是不明显的,删除这段代码,您将进入生产!

#5


5  

In order to set the browser cache turned off. Follow the instructions below:

为了设置浏览器缓存关闭。按照下面的说明:

MS IE

即女士

  1. from a menu select "Tools" for IE5 or "View" for IE4
  2. 从菜单中选择IE5的“工具”或IE4的“视图”
  3. select "Internet Options"
  4. 选择“互联网选项”
  5. in "Temporary Internet Files" section click on "Settings"
  6. 在“临时互联网文件”部分,点击“设置”
  7. select "Every visit to the page" for "Check for newer versions of stored pages" save the settings I hope this may help please check
  8. 选择“每次访问页面”为“检查新版本的存储页面”保存我希望这有助于检查的设置

#6


4  

hit "Fn F12" to open developer tools

点击“Fn F12”打开开发人员工具

click Cache

单击缓存

choose "Always refresh from server"

选择“总是从服务器刷新”

Every time you refresh it should be clearing the cache, but there are also quick access cache clearing from the cache menu or the shortcuts that are active when the dev tools are open.

每次刷新时,它都应该清除缓存,但也有从缓存菜单或打开开发工具时活动的快捷方式进行快速访问缓存清理。

*Note- you must leave the dev tools window open, it doesn't have to be up front, but it has to remain open for the cache to remain disabled.

*注意——必须让dev tools窗口保持打开状态,它不必在前面,但必须保持打开状态,才能使缓存保持禁用状态。

#7


3  

Ctrl+Shift+Del will open the Clear Private Data dialog (or select it from the Safety menu). Uncheck everything but the first two items to clear only the cache.

Ctrl+Shift+Del将打开Clear Private Data对话框(或者从安全菜单中选择)。取消除前两项之外的所有检查,只清除缓存。

You shouldn't have to clear the cache though. If you access your js files through a web server (such as IIS running locally), the normal cache control mechanisms should do the trick. If they don't, a Ctrl+F5 usually fixes the problem.

你不需要清除缓存。如果您通过web服务器(比如本地运行的IIS)访问您的js文件,那么通常的缓存控制机制应该能够做到这一点。如果没有,Ctrl+F5通常会解决这个问题。

#8


2  

If your javascript files are served exclusivley from a sub-directory, you could enable immediate content expiration for that directory in IIS. I recently had this problem serving content from a sub-directory and this was the fastest, simplest solution that I found.

如果您的javascript文件从子目录中提供了exclusive sivley,那么您可以为IIS中的目录启用即时内容过期。我最近遇到了从子目录中提供内容的问题,这是我找到的最快、最简单的解决方案。

#9


1  

Open the IE debugging tools (F12), Cache on the menu, and select always refresh from server. This does mean you need to keep the debugging tools open.

打开IE调试工具(F12),在菜单中缓存,并从服务器中选择always refresh。这意味着您需要保持调试工具的开放。

#10


0  

Maybe a easier way not to have user refresh the browser is just to rename the js files (and css). This is what worked for me... as the server didn't like a random number after the .js file

不让用户刷新浏览器的一个更简单的方法是重命名js文件(和css)。这就是我的工作…因为服务器不喜欢.js文件后面的随机数

#1


67  

Go to Internet Options. On the General tab, under Browsing History click Settings. Select the "Every time I visit the webpage" radio button.

去网络选项。在“常规”选项卡上,在“浏览历史”下单击“设置”。选择“每次访问网页”单选按钮。

This doesn't "disable" the cache per se, but it should fix your underlying problem - the JS files should be reloaded every time.

这并不“禁用”缓存本身,但它应该修复底层的问题——JS文件应该每次都重新加载。

#2


16  

Ctrl+F5 Should cause a full page refresh including all that cached javascript.

Ctrl+F5应该会导致整个页面的刷新,包括所有缓存的javascript。

Occasionally though, you'll still need a cache clear, because even Ctrl+F5 won't work, for reasons beyond comprehension IE can't even get "refresh" right 100% of the time.

有时候,你仍然需要一个缓存清除,因为即使是Ctrl+F5也不能工作,原因是无法理解的,IE在100%的时候都不能得到“刷新”。

#3


11  

If that fails, a random parameter on the query string will do it:

如果失败,查询字符串上的随机参数将执行此操作:

index.html?a=346456

index . html ? = 346456

#4


10  

Load you JavaScript this way.

以这种方式加载JavaScript。

<html>
...
<script type="text/javascript">
document.write('<script src="yourscript.js?'+Math.random()+'"></script>');
</script>
...
</html>

Edit: In case this is not obvious, remove this code as soon you will go into production!

编辑:如果这是不明显的,删除这段代码,您将进入生产!

#5


5  

In order to set the browser cache turned off. Follow the instructions below:

为了设置浏览器缓存关闭。按照下面的说明:

MS IE

即女士

  1. from a menu select "Tools" for IE5 or "View" for IE4
  2. 从菜单中选择IE5的“工具”或IE4的“视图”
  3. select "Internet Options"
  4. 选择“互联网选项”
  5. in "Temporary Internet Files" section click on "Settings"
  6. 在“临时互联网文件”部分,点击“设置”
  7. select "Every visit to the page" for "Check for newer versions of stored pages" save the settings I hope this may help please check
  8. 选择“每次访问页面”为“检查新版本的存储页面”保存我希望这有助于检查的设置

#6


4  

hit "Fn F12" to open developer tools

点击“Fn F12”打开开发人员工具

click Cache

单击缓存

choose "Always refresh from server"

选择“总是从服务器刷新”

Every time you refresh it should be clearing the cache, but there are also quick access cache clearing from the cache menu or the shortcuts that are active when the dev tools are open.

每次刷新时,它都应该清除缓存,但也有从缓存菜单或打开开发工具时活动的快捷方式进行快速访问缓存清理。

*Note- you must leave the dev tools window open, it doesn't have to be up front, but it has to remain open for the cache to remain disabled.

*注意——必须让dev tools窗口保持打开状态,它不必在前面,但必须保持打开状态,才能使缓存保持禁用状态。

#7


3  

Ctrl+Shift+Del will open the Clear Private Data dialog (or select it from the Safety menu). Uncheck everything but the first two items to clear only the cache.

Ctrl+Shift+Del将打开Clear Private Data对话框(或者从安全菜单中选择)。取消除前两项之外的所有检查,只清除缓存。

You shouldn't have to clear the cache though. If you access your js files through a web server (such as IIS running locally), the normal cache control mechanisms should do the trick. If they don't, a Ctrl+F5 usually fixes the problem.

你不需要清除缓存。如果您通过web服务器(比如本地运行的IIS)访问您的js文件,那么通常的缓存控制机制应该能够做到这一点。如果没有,Ctrl+F5通常会解决这个问题。

#8


2  

If your javascript files are served exclusivley from a sub-directory, you could enable immediate content expiration for that directory in IIS. I recently had this problem serving content from a sub-directory and this was the fastest, simplest solution that I found.

如果您的javascript文件从子目录中提供了exclusive sivley,那么您可以为IIS中的目录启用即时内容过期。我最近遇到了从子目录中提供内容的问题,这是我找到的最快、最简单的解决方案。

#9


1  

Open the IE debugging tools (F12), Cache on the menu, and select always refresh from server. This does mean you need to keep the debugging tools open.

打开IE调试工具(F12),在菜单中缓存,并从服务器中选择always refresh。这意味着您需要保持调试工具的开放。

#10


0  

Maybe a easier way not to have user refresh the browser is just to rename the js files (and css). This is what worked for me... as the server didn't like a random number after the .js file

不让用户刷新浏览器的一个更简单的方法是重命名js文件(和css)。这就是我的工作…因为服务器不喜欢.js文件后面的随机数