Enricosoft
Enricosoft

Reputation: 981

Google Chrome IndexedDb strange physical space management

I'm using IndexedDb to "cache" images before send to server. I'm doing this because if the ajax call fails, I can retry the process without data loss (image base64 data and other related parameters to send).

Every time the ajax call upload an image, I remove the record from IndexedDb so my db will more for the most of the time empty or with few rows.

Now, I noticed that in Chrome DevTools the records are successfully deleted but on disk (%AppData%\Local\Google\Chrome\User Data\Default\IndexedDb) the files continue to get space becoming always bigger... even more than 1gb.

If you close chrome browser and then go to check the IndexedDb physical files size, you can see the space has decreased but still get a lot of mb (e.g. from 1,39gb to 500mb).

My question is: why if my IndexedDb on DevTools is empty, on disk I still have big files? Is there a way to fix this behaviour? Is this could be a problem for chrome? (e.g. Crash or performance degradation)

Upvotes: 0

Views: 609

Answers (1)

Enricosoft
Enricosoft

Reputation: 981

It's a bad physical file management (a bug or a choice? I don't know). There's no solution. The only way to free space is to delete the indexeddb programmatically from javascript and create new one... I mean for example every 30 photos stored in a single db, create new db to store newer photos. When the photos stored in a single db are uploaded, we can delete programmatically it.

Upvotes: 0

Related Questions