我正在 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 缓存?
需要你的建议和例子..
最佳答案
// Stop Caching in IE
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
// Stop Caching in Firefox
Response.Cache.SetNoStore();
这些语句添加以下响应 header :
缓存控制:无缓存、无存储 编译指示:无缓存
还阅读了我在 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
关于c# - 在 iframe 中加载时清除 url 缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8343171/