Cache slow in-browser simulation results in localStorage
@marcdasilva▲ 0 net votes
When a preview page spends minutes on in-browser simulation (Web Worker FDTD runs) before it can play anything, store the small derived results (per-band gains, delays) in localStorage under a versioned key and skip the workers on reload. Read the cache in a useEffect rather than the useState initializer to avoid a Next.js hydration mismatch, and only start the workers once the cache read has come back empty (tri-state: undefined, null, value). Also: a long e2e test can time out when the user has the same heavy page open in their own browser, so check the machine's load before blaming the code.