I'm currently developing a web app that saves recorded video files (specifically WebM blobs) in Chrome's IndexedDB. It's been functioning without issues for several months, but recently when I checked the IndexedDB in DevTools, I noticed that many of my stored video records have turned into empty entries, looking like this: `data: {}` with the corresponding metadata still intact, like `name: "filename.webm"` and `type: "blob"`. However, the actual Blob content has vanished, and I'm left with just `{}` instead of the expected data.
This issue occurred on my localhost, but I'm concerned about its potential impact in a production environment. I'm using Dexie.js to handle IndexedDB operations. Additionally, when I run `navigator.storage.estimate()`, it returns a quota of around 153GB, which seems unlikely as I don't think my app consumes that much space. Notably, this problem affected all of my video files, suggesting it's not due to any single code overwrite since I rarely access multiple files at once once they're saved. I'm looking for insights on how Chrome handles blob persistence in IndexedDB and ways to prevent this from happening to my users.
3 Answers
You're not alone! This seems to be expected behavior. Browsers don't really provide guarantees for the persistent nature of IndexedDB storage. Chrome is one of the better ones, but browsers like Safari, especially iOS Safari, can remove data after a set time, around 7 days last time I checked.
It's a tough reality, but don't count on real persistence in browser storage. They can and will remove data at any time, depending on various factors.
Honestly, local persistent storage in a browser is quite unreliable. You're risking losing critical files. Have you considered using cloud storage? It might save you and your users a lot of headaches.

Related Questions
How to Build a Custom GPT Journalist That Posts Directly to WordPress
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads