> On Nov 29, 2017, at 3:39 AM, Quinn The Eskimo! <eski...@apple.com> wrote: > > `cres2` comes back as non-nil, even though `req2` has a different > `User-Agent` header than the `req1` that was used to store the response. So, > are you sure that the `User-Agent` string is the problem here?
Hmm. I've setup the response with the same fields as your (very helpful) example, however I still only get a cached response when I omit the User-Agent header. I'm not sure if this is relevant, but besides the User-Agent header I also add a Authorization header in the request - this is basically static for every request. The only other difference from your example is that in my case I'm (obviously) not using a shared NSURLCache within the same process, but given that it seems to work for me when I omit the User-Agent header, that's probably not relevant. I'll keep playing with the headers/request and see if I can narrow down when it stops working, and perhaps try some of your other suggestions, on which I'll note: > The most obvious solution here is to have both the app and the helper set the > same `User-Agent` string. That seems reasonable given that one is embedded > within the other. Why not do that? I thought of that, but my other worry would be the case where a new version of the application is available - as I mentioned the header includes the version number, so I worry that future versions wouldn't pick up on past cached responses due to the differing header (if it does turn out to be relevant). _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com This email sent to arch...@mail-archive.com