Lesson 0006 · ~12 minutes · synthesis
One skill: given a feature brief, write a complete service-worker choice — yes/no, lifecycle plan, fetch policy, and one risk you own.
Defend a service worker choice (or rejection) in a design review without “add Workbox and hope.” This is the durable skill from MISSION.md.
You can finish from lessons 1–5 alone. External reads stay optional.
Network policy / offline shell → SW. CPU jank → dedicated worker. Warehouse only → Cache Storage. Static CDN enough → skip SW. (L1, L5)
register + scope; install precache (waitUntil); activate
cleanup; update = wait / skipWaiting; claim optional.
Version cache names. (L2–L3)
respondWith or let network through; navigate vs asset
vs API; clone on put+return; strategy names from Cache API track.
(L4)
Stale shell, update lag, wrong cache-first, dual-cache, HTTPS, no DOM, progressive enhancement, DevTools plan. (L5)
“We use / skip a service worker because job; lifecycle is …; fetch policy is …; we own risk.”
Keep the print playbook after this course.
SPA must show shell HTML/CSS/JS on airplane mode after a prior visit. Fingerprinted assets. Same-origin. HTTPS.
Photo editor: large filter freezes the UI for seconds. Network is fine; no offline product goal in this brief.
Banking SPA already has an offline shell SW. New requirement: account balances must never show stale success from cache.
Product wants new SW live ASAP after deploy even with tabs open. Team accepts brief mixed-version risk.
Re-skim only what still feels soft: lifecycle · Offline Cookbook · Learn PWA · SW.