For the More Curious: Automatic Caching and Cache.db

While in Nerdfeed’s sandbox, you may have noticed a file named Cache.db. This file contains data that resembles the XML and JSON returned from the RSS web services. iOS applications keep the data from web service requests here. When an HTTP request is made, the response from the server may tell the application, This data will be good for a day, so don’t bother me again in the meantime. An iOS application has built-in behavior to understand this response and to cache the data returned in the Cache.db file until it expires.

Earlier in the chapter, when asking repeatedly for Apple’s top songs feed, you may have noticed that the repeated requests returned very quickly – even before we implemented ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.