Reference · print-friendly
One page for design reviews. Walk top to bottom; stop when a row rejects the current candidate.
| If… | Prefer… |
|---|---|
| Re-fetch is cheap; no offline need | Memory only (skip durable client store) |
| Tiny string flags | sessionStorage / localStorage (sparingly) |
| HTTP assets / app shell / resource responses | Cache Storage (+ usually a service worker) |
| Durable structured app data (drafts, entities) | IndexedDB |
| File-shaped editor pipelines | OPFS |
| Must-be-live money / auth actions | Network only — honest offline failure |
static-v3,
pages-v2
open → add/put →
match
add/addAll = fetch + 200-range only;
put = you supply Response (more permissive)
caches.delete(name) drops a whole generation;
cache.delete(req) one entry
waitUntil(addAll)
add fails; put is a tradeoffQuotaExceededError; bound
runtime caches
response.clone() when both putting and returning
“We use Cache Storage | IndexedDB | memory | … because job; warehouse is named versions + put/match shape; policy is install/activate + strategy per route; we own one risk (cleanup / opaque / dual-cache / quota).”