Cache Strategy Playground

The neighbourhood head answers the villagers from his box of copies or sends Dodi running to the sekretariat: network-first, cache-first or…

Why it matters

The network is slow and sometimes down; a cache is quick but can go stale. The wrong strategy makes an app slow, shows old data, sends a POST again, or shows another account’s data. Service workers, SWR and React Query use exactly the same terms.

The key idea

Quick and fresh pull against each other

Common mistakes

Try it in this playground