gpt4 book ai didi

c# - 在 iframe 中加载时清除 url 缓存

转载 作者:行者123 更新时间:2023-11-28 10:06:12 26 4
gpt4 key购买 nike

我正在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com