Does anyone know why this request is being cached?
I'm using an unmodified
.default
URLSessionConfiguration
.The response headers are:
(from Charles, confirmed from debugging the response in the data tasks's completion block)
{
"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;
}
I'm verifying that the request is cached using Charles proxy - the first request appears, but subsequent requests don't.
Using
.ephemeral
session configuration, or setting a custom url cache with 0 for memory and disk size shows all the requests in Charles, so I know Charles is a valid test.
I've always assumed that without cache headers a response won't be cached :|
Any ideas anyone?
EDIT: Here's the request I'm making
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