Reject / redirect
- Structured entities / drafts / queues → IndexedDB, not OPFS files
- HTTP app shell / network resources → Cache API (+ SW)
- Tiny string flags → memory / careful Web Storage
- User-visible open/save paths → File System Access pickers
- Multi-device truth → server + explicit sync (OPFS does not sync)
Private vs user-visible
- OPFS is origin-private — not in Finder/Explorer
- Root via
navigator.storage.getDirectory() only (no picker)
- Export to UVFS is copy, not
move
- In-app browse/export UX if users need to recover data
Will it stick?
- Shares origin quota with IDB / Cache / etc.
- Best-effort eviction under disk pressure (LRU origins common)
- Catch
QuotaExceededError; bound growth; delete on purpose
navigator.storage.estimate() (+ usageDetails.fileSystem)
- Optional
navigator.storage.persist() for critical local data
- Safari / inactivity policies — re-hydrate path; don’t pitch forever
- Clear site data / private mode wipe OPFS
Runtime hygiene
- Heavy byte work → dedicated worker (sync access when needed)
- Default exclusive lock → ownership plan across tabs/workers
- Always
close() access handles; check partial write
- Folder layout / generation names for schema evolution
- Budget debug time (DevTools uneven; OPFS Explorer extension)
60-second scan
Wrong tool? · Private vs UVFS clear? · Eviction / clear-data / Safari?
· Quota + delete plan? · Worker vs main? · Lock ownership? · Sync /
re-hydrate explicit?