Lesson 0005 · ~12 minutes · synthesis
One skill: given a feature brief, write a complete caching choice — store, warehouse shape, serving strategy, and one risk you own.
This is the durable skill from MISSION.md: defend a Cache Storage choice (or rejection) in a design review without hand-waving.
You can complete this from lessons 1–4 alone. External web.dev/MDN reads remain optional enrichment, not a gate.
Run in order. Earlier gates reject more options than later ones.
What must live on the client? Memory if re-fetch is fine. Web Storage only for tiny strings. Cache Storage for HTTP assets / shell. IndexedDB for structured app data. OPFS for files. Network-only for must-be-live money. (Lessons 1, 4)
Named versioned caches; Request/Response only;
add vs put; match rules (query / method /
Vary); delete entry vs delete whole name. (Lesson
2)
SW: install precache, activate cleanup, fetch strategy per route (cache-first, network-first, SWR, network-only, cache-only). Warehouse ≠ policy. (Lesson 3)
Versioning/no-expiry, opaque/CORS, HTTP cache vs SW, quota/eviction (Safari caps), clone when put+return, runtime bloat bounds. (Lesson 4)
“We use Cache Storage | IndexedDB | memory | … because job; warehouse is named versions + put/match; policy is install/activate + strategy; we own cleanup | opaque | dual-cache | quota.”
Keep the print playbook open after this course — compressed form of all five lessons.
Pick the best default package. Equal-length options.
SPA must show UI offline on return visits. Fingerprinted JS/CSS +
index.html. No entity offline store in this brief.
Notes app: multi-KB rich drafts offline, filter by project, reopen days later same browser. Sync may lag. Same-origin SPA.
Show avatars immediately; slightly stale is fine; update on later visits. Many unique URLs over months.
Payment intent and cart total must never display a stale cached amount as if it were the live server truth.
Team ships static-v1…v5 never deletes old names; SWR
assets also have year-long max-age. Users report old JS
after deploys.
When you want the deferred primaries: Storage for the web, Cache API quick guide, Offline Cookbook, SW caching and HTTP caching.