Cache Then Network

Serve the stored copy immediately, then the fresh one, from a single repository flow — and emit an error only when nothing was served, because an error after a successful emission replaces working content the user is already reading. Use when a screen shows a spinner on every open despite having shown the same data a minute ago, or when a brief network failure blanks a screen that had perfectly good content on it.

maxrave-dev 4f95492 6.2 KB Updated

File contents

maxrave-dev/kotlin-footguns/tree/main/skills/cache-then-network commit 4f954929c0

Frequently asked questions

npx skillmds@latest add maxrave-dev/cache-then-network