network-first strategy
A caching strategy that tries the network first for fresh data and falls back to the cached copy only when the request fails.
In more detail
It suits API data and pages that change often. On a slow but working connection users still wait for the network, so a timeout is often added.
Related terms
- cache-first strategy — A caching strategy that answers from the cache when possible and only goes to the network, then caches the result, on a miss.
- stale-while-revalidate — A caching strategy that answers immediately from the cache, even if out of date, while fetching a fresh copy in the background for next time.
Taught in
- Cache Storage API: Offline Strategies And Cache-First Patterns — Frontend Architecture & Web Platform