在iframe中加载url时清除url缓存

clear url caching when it is loaded in iframe

本文关键字:url 缓存 清除 加载 iframe      更新时间:2023-09-26

我正在加载一个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">

如何避免所有浏览器的缓存?如何避免url缓存时,它是加载在iframe?

需要你的建议与例子…

// Stop Caching in IE
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
// Stop Caching in Firefox
Response.Cache.SetNoStore();

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

Cache-Control: no-cache, no-store编译指示: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

no-cache指令导致浏览器每次加载页面时都请求内容。这和阻止它下载不是一回事。

这听起来不像是你在试图避免缓存,而是你在试图避免将下载的文件保存到本地文件系统。no-store是实现这一目标的方法,但这并不意味着浏览器不能存储,而是它必须"尽最大努力"避免将文件存储在非易失性存储中。

我不知道如果没有临时存储文件,是否有浏览器支持这个-我找不到任何支持图表。