My server sets the etag header element to support caching.
IOS application (6.1.4) uses its own NSURLConnection class to send an XML request to the server
The first time the server sends a response with the etag setting in the header
If the iOS application sends the exact same request to the server, I can see in the server logs that the if-none-match header is not populated by NSURLConnection
... and then the server responds 200 instead of 304
The cache policy used for the request:
[request setCachePolicy:NSURLRequestReturnCacheDataElseLoad]
NSURLCache is initialized with
[[NSURLCache sharedURLCache] setMemoryCapacity:1024*1024*10];
My questions: - Is it normal that NSURLConnection did not set the if-none-match header field? - Do I need to set this header field myself? (getting a response from the cache, reading the etag value and setting in the request header)?
fvisticot
source share