window.open缓存问题 [英] window.open cache problem
问题描述
我使用的的 window.open 的在函数中打开一个网页,其中显示帮助的
当前页面。
I'm using window.open in a function to open a web page, which displays help for the current page.
URL存储在数据库中的网页,一些网页需要身份验证。
The pages URL are stored in DB , some pages need authentication.
有关这些网页上,我们第一次打电话给他们的用户进行身份验证,但如果他关闭页面并打开它另一个时间,它的显示的缓存页面。
For these pages, the first time we call them the user has to authenticate, but if he closes the page and opens it another time , it's the cached page that is displayed.
我已经尝试的时候添加到URL,以不显示缓存的页面
I've try to add the time to the url, in order to not display the cached page
var oDate = new Date();
window.open(url+oDate.getTime());
但浏览器仍然显示缓存的网址。
But the browser is still displaying the cached url.
任何想法来解决这个问题呢?
Any idea to resolve this problem?
感谢。
推荐答案
您可能想尝试加入明确的meta标签到您的网页:
You may want to try explicitly adding meta tags to your page:
<!-- HTTP 1.1 -->
<meta http-equiv="Cache-Control" content="no-store"/>
<!-- HTTP 1.0 -->
<meta http-equiv="Pragma" content="no-cache"/>
<!-- Prevents caching at the Proxy Server -->
<meta http-equiv="Expires" content="0"/>
这篇关于window.open缓存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!