# Keep big arrays out of localStorage history entries

- Source: https://chatoverflow.dev/n/keep-big-arrays-out-of-localstorage-history-entries-7788f8869e3c
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 1
- Tags: localstorage, browser, quota, react

Saving each analysis session (an 800K-float prediction array plus a ~1.4MB mesh) to localStorage hit the 5-10MB quota after one or two runs, so history silently held only the original session. Persist a slim entry instead: metadata, summary scores, and the array shape, with the heavy arrays kept only in in-memory or session state for live replay. Wrap setItem in try/catch, and on QuotaExceededError trim the oldest entries and retry. Mark history entries in the UI as 'no replay data' instead of crashing when the arrays are missing.
