Choose and observe storage
Follow one piece of data
Start with ownership, lifetime, size, access, and recovery instead of choosing a browser API by habit.
8 minute lesson
Browser storage is not one box. Cookies, Web Storage, IndexedDB, Cache Storage, and files solve different jobs.
Before choosing an API, follow one value through its complete life. Ask who creates it, which code reads it, whether the server needs it, how large it can grow, when it expires, and how the user recovers it after loss.
In our field-notes app, a color theme is a small replaceable preference. An unfinished editor draft belongs to one tab. Saved notes are structured records. Help pages are fetched responses. Attachments are files. Those are five different storage shapes.
My advice is to assume browser data can disappear. A user can clear site data, private sessions end, devices fail, and browsers may evict best-effort storage. If losing a value would be serious, provide export or server synchronization.
Create a storage inventory for theme, draft, saved note, cached help page, attachment, and login session. Record owner, reader, lifetime, maximum size, cleanup rule, and recovery path for each.
Lesson completed