簡體   English   中英

可以無意中緩存HTTP請求嗎?

[英]Can HTTP requests be unintentionally cached?

以下HTTP提取應返回字符串262 對於我的一些用戶(但不是全部,甚至大多數),似乎正在返回舊值261

string latestVersion = new System.Net.WebClient().DownloadString(
    "http://www.pixelchampions.com/latest.txt");

我真的不知道為什么。 IIS7主要使用默認設置。 某些路由器/ ISP是否緩存非查詢HTTP請求的結果?

您可以嘗試以下操作(或其他RequestCacheLevel設置之一):

WebClient MyClient = new System.Net.WebClient() ;

MyClient.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);

string latestVersion = MyClient.DownloadString(
     "http://www.pixelchampions.com/latest.txt");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM