防止在Internet Explorer 8中缓存页面 [英] Prevent caching of pages in 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 options → browsing 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屋!