Lesson 0006 · ~12 minutes · synthesis

Ship the decision, not the buzzword

One skill: given a feature brief, write a complete service-worker choice — yes/no, lifecycle plan, fetch policy, and one risk you own.

Mission payoff

Defend a service worker choice (or rejection) in a design review without “add Workbox and hope.” This is the durable skill from MISSION.md.

Lesson-only path

You can finish from lessons 1–5 alone. External reads stay optional.

1. Four gates (run in order)

A · Job

Network policy / offline shell → SW. CPU jank → dedicated worker. Warehouse only → Cache Storage. Static CDN enough → skip SW. (L1, L5)

B · Lifecycle

register + scope; install precache (waitUntil); activate cleanup; update = wait / skipWaiting; claim optional. Version cache names. (L2–L3)

C · Fetch policy

respondWith or let network through; navigate vs asset vs API; clone on put+return; strategy names from Cache API track. (L4)

D · Ship risks

Stale shell, update lag, wrong cache-first, dual-cache, HTTPS, no DOM, progressive enhancement, DevTools plan. (L5)

Sentence you should be able to say

“We use / skip a service worker because job; lifecycle is ; fetch policy is ; we own risk.”

Keep the print playbook after this course.

2. Practice — full briefs (4 cards)

Brief A · Offline shell

SPA must show shell HTML/CSS/JS on airplane mode after a prior visit. Fingerprinted assets. Same-origin. HTTPS.

Brief B · Heavy filter

Photo editor: large filter freezes the UI for seconds. Network is fine; no offline product goal in this brief.

Brief C · Live balances

Banking SPA already has an offline shell SW. New requirement: account balances must never show stale success from cache.

Brief D · Fast updates

Product wants new SW live ASAP after deploy even with tabs open. Team accepts brief mixed-version risk.

3. Keep the playbook

  1. Gate A rejects most bad ideas in 15 seconds.
  2. Gates B–C are the “how,” not the “whether.”
  3. Gate D names the risk you will own in production.
  4. Print decision-playbook.html + checklist.
Ask your teacher Paste a real feature brief from work — we’ll run the four gates on it in chat.

Primary (optional)

Re-skim only what still feels soft: lifecycle · Offline Cookbook · Learn PWA · SW.