IE8 中的 Google Chrome Frame (GCF) 缓存问题
也许有人在某个地方问过这个问题,但我试图找到我的问题,但找不到任何答案。
我的问题是:
我正在开发一个网络应用程序,由于 IE8 中的一些主要 JavaScript 问题,我需要用户运行“Google Chrome Frame”(以提高网页的速度)。令我印象深刻的是,我的页面工作 100% 正常,直到它应该刷新时却没有刷新(使用 jQuery 的 Ajax getJSON
请求)。
问题是它不会请求服务器上的新数据,但看起来它会进入缓存以获取该请求的答案,然后每次都返回相同的内容而不是新数据。
我真的不知道如何解释,但它就是不更新。另外,当我在页面上点击 F5 时,它不会更新页面,它会保留旧页面(即使我点击 CTRL-F5 或任何其他正常的强制刷新按钮)。要进行更改,我实际上需要关闭浏览器(IE8)并重新打开它,以便它可以接受新的更改。
有谁知道当 Google Chrome 内嵌框架处于活动状态时如何禁用缓存?
我使用的元标记是:
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<META HTTP-EQUIV="X-UA-COMPATIBLE" CONTENT="CHROME=1">
如果您需要更多详细信息,请随时询问。
Maybe it has been asked somewhere, but I am trying to find my question and I am not able to find any answer.
Here's my question:
I am developing a web application and because of some major JavaScript issue in IE8, I need the user to run "Google Chrome Frame" (To enhance the speed of the web page). I was impressed that my page was working 100% fine until the time it was supposed to be refreshing and it wasn't refreshing (Ajax getJSON
request using jQuery).
The problem is that it does not request the new data on the server, but it looks like it goes in the cache for the answer of that request and then return the same thing every time instead of new data.
I don't really know how to explain it, but it just does not update. Also, when I hit F5 on the page, it does not update the page, it keeps the old page (even if I hit CTRL-F5 or any other normal force-refresh button). To have the changes, I actually need to close the browser (IE8) and re-open it so it can take the new changes.
Is there anyone who know how I could disable the cache when Google Chrome Frame is active?
The meta tag I use is :
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<META HTTP-EQUIV="X-UA-COMPATIBLE" CONTENT="CHROME=1">
If you need any more details, don't hesitate to ask.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个古老的 CGI 技巧是将日期编码为请求中的参数,以便 URL 随每个请求而变化。这通常会停止 URL 上的任何缓存。
因此,如果您将日期和时间编码为毫秒,您将得到url?01102010134532。
如果我正确理解您的要求,您必须在 JQuery / JS 中执行此操作,并且需要在发出每个 AJAX 请求后修改 URL 上的参数,因此下一个请求将与上一个不同
An old CGI trick would have been to encode the date as a parameter onto the request so the URL changes with each request. That generally stops any caching on the URL.
So you'd have url?01102010134532 if you encoded date and time down to miliseconds.
If I understand your requirement properly, you'd have to do this in JQuery / JS and would need to modify the parameter on the URL after each AJAX request was made, so the next one would be different to the previous