Reference · print-friendly

sessionStorage decision playbook

One page for design reviews. Walk top to bottom; stop when a row rejects the current candidate.

1. Gate A · Job (which store?)

If… Prefer…
Re-fetch is cheap; no session continuity Memory only
Small string/JSON; this tab only; die on close OK; isolation is a feature sessionStorage
Tiny string; survive restart; share all tabs localStorage (sparingly)
Auth cookies / must travel with HTTP Cookies (careful) — not Web Storage as a vault
Durable structured app data IndexedDB
HTTP assets / app shell Cache Storage (+ SW)
File-shaped bytes OPFS
Multi-tab live sync of one key BroadcastChannel / localStorage events / server — not sessionStorage

2. Gate B · Shape (if Web Storage)

3. Gate C · Lifetime & isolation

4. Gate D · Ship risks

Sentence to say in review

“We use sessionStorage | localStorage | memory | IDB | … because job + lifetime; shape is methods + JSON; isolation is tab-only / cross-tab; we own probe · quota · no secrets · no multi-tab bus.”