NSURLCache

NSURLCache provides a composite in-memory and on-disk caching mechanism for URL requests to your application. As part of Foundation’s URL Loading System, any request loaded through NSURLConnection will be handled by NSURLCache.

nshipster.com/nsurlcache/

NSURLCache is the built-in, automatic HTTP(S) cache used by NSURLConnection, NSURLSession (default/ephemeral configs), and WKWebView.

Key points:

Bottom line: two lines at startup give you free, fast, offline-capable networking. Don’t reinvent caching.


Enjoyed this post?

Well, you could share the post with others, follow me with RSS Feeds, send me a comment via email, and/or leave a donation in the Tip Jar.


Tags

Category:

Year: