Performance
December 22, 2025·5 min read

IndexedDB for Persistent Image Session History

Storing compression history, settings, and before/after results in the browser using IndexedDB.

ER

Elena Rostova

Contributing Author · Squoosh Next Blog

IndexedDB is the browser's built-in transactional database capable of storing arbitrary JavaScript objects including large binary data like image blobs. For an image optimization tool, it enables features like session history (a log of all files compressed, their original and output sizes, codec settings, and timestamps), preset management (saving user-configured codec settings as named presets for reuse), and offline operation (previously compressed output is cached and accessible without internet). The key design consideration is storage quota management.

Browsers grant 60–80% of remaining disk space for IndexedDB, but you should implement a rolling eviction strategy that deletes entries older than 30 days or when total stored size exceeds 500MB. The Squoosh Next session history panel uses IndexedDB with a structured object store indexed by timestamp and file hash.

Key Takeaways
  • IndexedDB is the browser's built-in transactional database capable of storing arbitrary JavaScript objects including large binary data like image blobs.

  • For an image optimization tool, it enables features like session history (a log of all files compressed, their original and output sizes, codec settings, and timestamps), preset management (saving user-configured codec settings as named presets for reuse), and offline operation (previously compressed output is cached and accessible without internet).

  • The key design consideration is storage quota management.

  • Browsers grant 60–80% of remaining disk space for IndexedDB, but you should implement a rolling eviction strategy that deletes entries older than 30 days or when total stored size exceeds 500MB.

Try It in the Workspace

Everything discussed in this article can be tested directly in Squoosh Next — no sign-up, no upload, 100% client-side.

More in Performance
Web Workers: Offloading Heavy Compression Tasks
April 20, 2026 · 6 min read
Core Web Vitals and Image Optimization
November 28, 2025 · 9 min read
Browser DevTools for Image Performance Auditing
September 29, 2025 · 8 min read
Squoosh Next

Professional client-side image compression and format optimization tool. Compress, convert, and adjust 100+ formats instantly without server uploads.


© 2026 Squoosh Next. Developed & Maintained by Naushad Alam | Zest Tech Solution | Powered by Vercel.Contact: Naushad Alam | WhatsApp: 7492068998 | Email: contact@zestcommerce.in | Web: zesttechsolution.cloud
Security EncryptedNo Uploads
Operational
v2.1.0Commit: d05d63e
0s
Build Info
Environment: productionBranch: masterBuild Time: 25s
Deployment
Deployed: 7/13/2026, 1:15:24 AMUptime: 0sPlatform: Vercel
Performance
Response: 0msStatus: OnlineSSL: Active
Technology
Next.js: 16.2.9React: 19.0.0TypeScript: 5.0