I'm interested in the lifetime of cached data stored with these two
implementations. What's the difference?
A cache that’s specifically designed to support offline mode would not be a cache. A cache, by definition, is a “software component that stores data so that future requests for that data can be served faster”. That gives the cache lots of flexibility in how it’s implemented.
Supporting offline mode is not about making things faster [1], it’s about making things work at all. Such a structure would have to provide guarantees that are not related to performance but are required for correctness. For example, there would have to be a way to force data into the structure such that it never falls out. That’s not a cache IMO.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Well, unless you consider the delay waiting for the device to get back on the Internet to just be a performance issue (-: However, even that’s not really correct because you could imagine someone using offline mode for an app on a device that’s never going to get back on to the Internet.