Networking with URLSession - Part 6: Download and | Ray Wenderlich

Learn about URLSessionDownloadTask and URLSessionUploadTask to save results to a file, or upload a data object or a file.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3986-networking-with-urlsession/lessons/6

Hi audrey,
Thanks for your effort , i just wonder how to use the caching that it returns
from response , How can i get the caching and how can i benefit from this ?

the benefit happens automatically, if the server response includes expiration and validation info; for example, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching — using the default cache control policy, your app uses the cached version if it’s still valid.

For direct access to the cached data, see https://developer.apple.com/documentation/foundation/url_loading_system/accessing_cached_data