在 iframe 中加载时清除 url 缓存
我正在 iframe 中加载 url 内容。所以现在 url 信息会自动下载到用户的临时文件夹中。 我已经使用了以下代码:
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
如何避免所有浏览器的缓存? 在 iframe 中加载时如何避免 url 缓存?
需要你的建议和例子..
i was loading a url content in an iframe. so now the url information are automatically downloaded in to users temp folder.
i have already used the below code:
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
how to avoid caching for all browsers?
how to avoid url caching when it is loaded in iframe?
need ur suggestions with examples..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些语句添加以下响应标头:
Cache-Control: no-cache, no-store
Pragma: no-cache
也读过这个,我在 asp.net 论坛中找到它:
The following response headers are added by these statements:
Cache-Control: no-cache, no-store
Pragma: no-cache
also read this i found it in asp.net forums:
no-cache
指令使浏览器在每次加载页面时请求内容。这与阻止下载不是一回事。听起来您并不是在尝试避免缓存,而是在尝试避免将下载的文件保存到本地文件系统。
no-store
是您发现的实现此目的的方法,但这并不意味着浏览器无法存储,而是必须“尽最大努力”避免将文件存储在非易失性中贮存。我不知道是否有浏览器在不临时存储文件的情况下支持此功能 - 我找不到任何支持图表。
the
no-cache
directive causes the browser to request the content every time the page loads. That's not the same thing as preventing it from downloading.It doesn't sound like you are trying to avoid caching, rather you are trying to avoid saving downloaded files to the local file system. The
no-store
is the way to accomplish this as you found, but it does not mean that the browser cannot store, rather it must make a "best effort" to avoid storing the files in non-volatile storage.I don't know if any browsers support this without temporarily storing files - I couldn't find any support charts.