[英]iOS URLCache caching when it shouldn't (IMHO)
有誰知道為什么這個請求被緩存?
我正在使用未經修改的.default
URLSessionConfiguration
。
響應標頭是:
(來自Charles,通過調試數據任務完成塊中的響應確認)
{
"Accept-Ranges" = bytes;
"Content-Length" = 1480;
"Content-Type" = "application/json";
Date = "Mon, 22 May 2017 19:14:13 GMT";
Etag = "\"42bebc5fb88323b8cd145ed85ea7a018\"";
"Last-Modified" = "Mon, 22 May 2017 14:54:38 GMT";
Server = AmazonS3;
"x-amz-id-2" = "abcdefghijklmn";
"x-amz-request-id" = 1A2B3C4D5E;
}
我正在驗證使用Charles代理緩存請求 - 第一個請求出現,但后續請求沒有。
使用.ephemeral
會話配置,或者為內存和磁盤大小設置自定義url緩存為0顯示Charles中的所有請求,因此我知道Charles是一個有效的測試。
我一直認為沒有緩存標頭不會緩存響應:|
任何人的想法?
編輯:這是我正在提出的要求
po task.originalRequest
▿ Optional<URLRequest>
▿ some : http://s3-eu-west-1.amazonaws.com/path/path/configuration.json
▿ url : Optional<URL>
▿ some : http://s3-eu-west-1.amazonaws.com/path/path/configuration.json
- cachePolicy : 0
- timeoutInterval : 60.0
- mainDocumentURL : nil
- networkServiceType : __ObjC.NSURLRequest.NetworkServiceType
- allowsCellularAccess : true
▿ httpMethod : Optional<String>
- some : "GET"
- allHTTPHeaderFields : nil
- httpBody : nil
- httpBodyStream : nil
- httpShouldHandleCookies : true
- httpShouldUsePipelining : false
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.