2011-12-01 179 views
1

我在加載iframe中的url內容。所以現在url信息會自動下載到用戶臨時文件夾中。 我已經用下面的代碼:當它在iframe中加載時清除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緩存?

需要UR建議舉例..

+0

可能重複至http://stackoverflow.com/questions/2648053/preventing-iframe-caching-in-browser – Eduard

回答

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

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

下面的響應報頭將這些語句添加:

緩存控制:無緩存,無店鋪 雜注:無緩存

也看過這個,我發現它在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 
0

no-cache指令會導致瀏覽器在每次加載頁面時都請求內容。這與防止下載不同。

聽起來你並不是想避免緩存,而是試圖避免將下載的文件保存到本地文件系統。 no-store是您找到的方法,但這並不意味着瀏覽器無法存儲,而是必須盡最大努力避免將文件存儲在非易失性存儲中。

我不知道任何瀏覽器是否支持這個功能,而不臨時存儲文件 - 我找不到任何支持圖表。