Cache only
When a network resource is precached, you can choose to implement a policy of only using a cached version of the asset. This is known as the cache-only strategy.
When you know a resource can be safely cached long term, you can reduce more overhead in your application by eliminating unnecessary network chatter.
Retrieving these resources from the cache also means that the application can load faster and, of course, load offline. Just make sure they don't become too stale.
Here, any request for a network resource will be retrieved only from the cache and no network response will be used. This can be very valuable for long-term static resources, such as application core JavaScript and CSS files. You could also apply it to images such ...
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