This is ultimately fallout from the WKWebView update - had to change how we dealt with saved pages images pretty drastically.
Repro:
- checkout 5.0.4
- clean install to simulator
- start at obama, save the article,
- go back through previous 8 presidents saving them as well
- stop app
- checkout 5.0.5
- start charles proxy
- run 5.0.5 on top of old 5.0.4 data
For the steps above charles proxy indicated that, on startup...
- 403 images were fetched
- 75 image info queries were sent
- ~511 MB of data was transferred
Proposed fix:
- on save only save MWKArticle's "imageURLsForSaving" (these are all the images the article actually used at the resolution it used them) and let the gallery lazily fetch 1280px high res images only when that image is actually displayed in gallery
Extra credit:
- consolidate image info queries - run one query passing it list of all images we're wanting info about instead of doing separate query for each image