如何指示网络浏览器不缓存页面?

发布于 2024-07-13 08:02:42 字数 487 浏览 4 评论 0原文

我的 Internet Explorer 6.0 存在缓存问题,我想指示浏览器缓存他请求的页面。

更多信息:在我的页面中,有一个随机令牌,可以防止重新加载网站并发布相同的信息两次或更多次。

如果您现在将此页面添加为书签,则每次浏览器请求时,都必须指示浏览器刷新该站点。

Firefox 3.0.5 正确执行此操作,但 IE 6.0 将随机令牌保留在缓存中。

我在受影响的页面中包含了以下元标记:

<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">

有什么想法吗? 提前致谢!

I've got a caching problem with the Internet Explorer 6.0 and I want to instruct the browser not to cache the page he's requesting.

Further information: In my page, there's a random token that prevents reloading the site and posting the same information twice or more.

If you now bookmark this page, the browser has to be instructed to refresh the site, everytime he requests it.

Firefox 3.0.5 does this correctly, but IE 6.0 keeps the random token in cache.

I included following meta tags in the affected page:

<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">

Any ideas?
Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡淡绿茶香 2024-07-20 08:02:42

这是一个在谷歌上有很好记录的问题,可能在这里被欺骗了好几次,但fwiw这是我的标准块(C#):

Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1
Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1 
Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1 
Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1 
Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.0 
Response.AppendHeader("Expires", "Wed, 09 Jun 1993 00:00:00 GMT"); // HTTP 1.0

This is a fairly well documented googleable problem, and probably duped several times here, but fwiw this is my standard block (C#):

Response.AppendHeader("Cache-Control", "no-cache"); //HTTP 1.1
Response.AppendHeader("Cache-Control", "private"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "no-store"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "must-revalidate"); // HTTP 1.1
Response.AppendHeader("Cache-Control", "max-stale=0"); // HTTP 1.1 
Response.AppendHeader("Cache-Control", "post-check=0"); // HTTP 1.1 
Response.AppendHeader("Cache-Control", "pre-check=0"); // HTTP 1.1 
Response.AppendHeader("Pragma", "no-cache"); // HTTP 1.0 
Response.AppendHeader("Expires", "Wed, 09 Jun 1993 00:00:00 GMT"); // HTTP 1.0
苏佲洛 2024-07-20 08:02:42

检查您的服务器发送的 HTTP 标头,这些标头可以覆盖 HTML 元部分中的内容。

Check what HTTP headers your server is sending, these can over ride what is in the meta section in the HTML.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文