Generic fallback
The next step from the network falling back to the cache is to have a generic fallback for all requests. You should use this when no response was available either in the cache or from the network.
You can see this pattern employed across the Podstr application for podcast episodes and their associated images.
The trick here is to precache a fallback response for these particular network assets. I also advise that you apply this strategy by matching route variations and not individual URLs.
In the Podstr podcast application, there are generic fallbacks for the podcast pages, episode pages, and podcast logos. I identified each of these as dynamic resources that cannot be precached.
Typically, if you can't access the resource, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access