site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1511992774; bh=G0k9gh+4IosuBDLuqXCvHX71nFQi/iI5x1IpLhTDwAE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=mXo2RMYZncCGpkGonLiws15FJtpkNqtygfZhwuyj4ggvaQiv037udyqWrXnMXFb88b7vXIz88jmoXt4+2l+647omt7+tthIP+cNbxVKs7Ebn+Ynzhua3VFy5PV1gw4so3J1Eq9FEWp+pYD40ft3DAqw2f8MmX1qxSK+xX2SGXAoyArP2WSWwEZOYtBPs3o2wOINQJe3FdDn1xXjzneragb6TZCtP2ceD4LadaPzU4Hug07LR75N5Njku5MV7to+Yrs5WJ2zBFKQ+frxcgNOFOJhSN9g5VVYELvKBYko4uapb+25KUytTdAq6rjLe+msemUtnuLhVKMlP+rg2tD0DLw==
On Nov 29, 2017, at 3:39 AM, Quinn The Eskimo! <eskimo1@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/site_archiver%40lists... This email sent to site_archiver@lists.apple.com