iosnsurlcache

NSURLCache cachedResponseForRequest getting call twice


In my code i had override NSURLCache cachedResponseForRequest to send the cached response in case if downloaded already. But for some reason cachedResponseForRequest getting called twice. Could anybody know the reason?

Is this a default behaviour?


Solution

  • I'm pretty sure that the method in question is called from two different parts of the NSURLSession stack for very different reasons: