Steps to repro
- Launch the app, load the feed
- Lock the screen
- Unlock the screen
Also an issue with:
- Search (cache individual query results)
- Nearby (cache results for specific location)
- Site info (e.g. "Main page")
- Most read (pageviews data and previews)
Expected results
Cached data is displayed, expired data is re-fetched.
Actual results
All data is always refetched.
Dev notes
We're only storing feed data in memory, in an NSCache. Since that's purged when the app goes to the background, we have to re-download everything. Some options are:
- Use NSURLCache + maxage response headers
- We should be using this for all cache control, but has implications for CoreData
- Use some other manual, persistent caching solution
- NSCoding + manual expiration
- CoreData
- etc.