Wanted to know, because side effect of this could be to alert user that new data was available if didn’t get cached data. Bad idea? Was hoping not to have to compute checksum on data and store that for later comparison purposes (although I might be able to use the http response’s “last-modified” date instead of a checksum).
Share
The NSURLConnectionDelegate protocol has a connection:willCacheResponse: method. This method is invoked when a NSURLConnection receives and subsequently caches a response. It therefore provides you with a hook in which you could set a flag indicating that a cache is in use. Alternatively if you want to disable caching altogether you can return nil from your implementation.
A point worth noting is that if your delegate manages multiple NSURLConnections you will need to determine which one was the source of the response using the connection: parameter.