I'm using an IndexedDB for saving game data in Chrome.
An average game is about 4MB. After saving a few games, and then deleting them, the dev console's 'Resources' tab shows that my indexedDB is empty, as expected, but if I go to content settings, "Cookies and site data" it's showing me roughly 12MB as the indexedDB size on disk.
This is a after a refresh and even a restart of Chrome. The following is my code for deletion and I'm getting success when I delete and a query for the old data returns nothing, as expected.
database.indexedDB.deleteGame = function(nameIn){
var db = database.indexedDB.db;
var trans = db.transaction(["saves"], "readwrite");
var store = trans.objectStore("saves");
var wipeSlate = store.delete(nameIn);
wipeSlate.onsuccess = function(e) {
console.log("Old game wiped");
};
wipeSlate.onerror = function(e) {
console.log("I don't think the old game existed..." + e);
};
};
I've checked the following questions (and search results aren't showing anything too promising either):
- Why does an empty database take megabytes of space
- Does an empty field take up space in a database
- IndexedDB deleteDatabase does not reset version
- I seem to be getting a dirty read from an IndexedDB index. Is this possible?
But none of them deal with my question, any and all help very much appreciated.