In the NSOperation subclass, I use the following code to download the xml file from our server and then parse it:
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:15]; NSData * receivedData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
The second time I make the same request, the server returns HTTP 304, and the cached response data is stored in receivedData . So far so good.
My question is: can I get the same cache response when the device is disconnected?
source share