在 iframe 中加载时清除 url 缓存

发布于 2024-12-19 04:14:24 字数 405 浏览 0 评论 0原文

我正在 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 技术交流群。

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

发布评论

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

评论(2

无语# 2024-12-26 04:14:24
// Stop Caching in IE
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);

// Stop Caching in Firefox
Response.Cache.SetNoStore();

这些语句添加以下响应标头:

Cache-Control: no-cache, no-store
Pragma: no-cache

也读过这个,我在 asp.net 论坛中找到它:

Use the following tags inside head tag of your page.

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

Both the above tags should be included if you are not sure if server is HTTP/1.1 compliant. Also Include:-

<META HTTP-EQUIV="EXPIRES" 
CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">  tells the server which cache the page to expire the page in given time interval. An invalid interval like "0" or "-1" expires it immediately and causes a fetch of latest version of file, each time request is made.

you can get complete info at this link :- http://www.i18nguy.com/markup/metatags.html
// Stop Caching in IE
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);

// Stop Caching in Firefox
Response.Cache.SetNoStore();

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:

Use the following tags inside head tag of your page.

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

Both the above tags should be included if you are not sure if server is HTTP/1.1 compliant. Also Include:-

<META HTTP-EQUIV="EXPIRES" 
CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">  tells the server which cache the page to expire the page in given time interval. An invalid interval like "0" or "-1" expires it immediately and causes a fetch of latest version of file, each time request is made.

you can get complete info at this link :- http://www.i18nguy.com/markup/metatags.html
蓝色星空 2024-12-26 04:14:24

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.

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