Posts

NSURLSession Cache Policy

Image
Before start NSURLSession cache policy, we should connect a remind to NSURLConnection vs NSURLSession concepts. NSURLConnection  got its start a decade ago, with the original release of Safari in 2003 , as an abstraction on top of the Core Foundation / CFNetwork APIs. The name  NSURLConnection  actually refers to a group of the interrelated components that form the Foundation URL Loading System:  NSURLRequest ,  NSURLResponse ,  NSURLProtocol ,  NSURLCache ,  NSHTTPCookieStorage ,  NSURLCredentialStorage , and its namesake,  NSURLConnection . NSURLRequest  objects are passed to an  NSURLConnection  object. The delegate (conforming to the erstwhile informal  <NSURLConnectionDelegate>  and  <NSURLConnectionDataDelegate>  protocols) responds asynchronously as an  NSURLResponse , and any associated  NSData  are sent from the server. Before a request is sent to th...