+4
Loading
Feeds were loaded under URLSession's default cache policy. A response
with Last-Modified and no Cache-Control is then kept fresh for about a
tenth of its age — most of a day for a feed last changed a week ago —
and a refresh in that window missed the new episode.
FeedFetcher now loads feeds with .reloadRevalidatingCacheData, through
URLSessionFeedLoader.feeds(): a conditional request each time, so an
unchanged feed costs a 304, not a download. Chapters and transcripts
keep the default policy.
Checked against a local server: after the feed changed, the old policy
still returned the stale copy and the new one the fresh feed, then a
304; on the iOS simulator, cold launches went from cache hits to a 200
and then 304s.
Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>