防止在Internet Explorer 8中缓存页面 [英] Prevent caching of pages in Internet Explorer 8

查看:276
本文介绍了防止在Internet Explorer 8中缓存页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的IE8页面上,我有一些文本可以通过管理面板进行更改。例如:如果页面包含文本hello world,则5分钟后文本可能会有所不同,具体取决于管理员是否更改了文本。

On my page in IE8, I have got some text which gets changed through an admin panel. For example: if the page contains the text 'hello world', after 5 minutes the text could be different depending upon if the admin has changed it.

问题在于IE8缓存页面并再次显示相同的文本。如果我们清除缓存并刷新,则会更新文本。

The problem is with IE8 which caches the page and shows the same text again. If we clear the cache and refresh, the text is updated.

我正在使用< META HTTP-EQUIV =CACHE-CONTROL内容=NO-CACHE> 标记,以避免浏览器缓存。

I am using <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> tag to make refrain the browser from caching.

我看到如果我选择互联网选项浏览历史记录(设置)→每次访问网页时,问题都会消除;但如果设置为自动,则会显示页面的缓存版本。

I have seen that if I select Internet optionsbrowsing history (settings) → every time I visit the web page, the problem is eliminated; but if it's set to automatic, the page's cached version is shown.

即使IE8中的缓存选项已设置,我是否可以强制执行'禁止缓存'自动,由最终用户?

Is there a way I can force 'no-caching' even if the caching option in IE8 is set to automatic, by the end-user?

推荐答案

您可以强制Internet Explorer不使用以下标题缓存您的页面:

You can force Internet Explorer not to cache your page using the following headers:

Expires: -1
Cache-Control: private, max-age=0

↪参见如何在所有浏览器中控制网页缓存?

这篇关于防止在Internet Explorer 8中缓存页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆