I'd like to get a breakdown of how much storage space a web app I'm working on is taking up. More specifically I'm interested in the size of data stored in indexedDB.
I know I can use navigator.storage.estimate()
to get a total value, but it shows over 1 mbyte even with an empty db, and I'm interested in knowing the size of indexedDB specifically.
Is there a way to check the size?
There is not currently a standard (or even non-standard) API that gives a breakdown of storage usage by type.
In Chrome's DevTools, the Application tab provides a breakdown of storage by type; click the "Clear storage" view in the top left and a graph should appear. This is useful for local debugging, but not understanding storage usage "in the wild"
There's some discussion about extending navigator.storage.estimate()
with this data at https://github.com/whatwg/storage/issues/63
UPDATE: navigator.storage.estimate()
now provides a breakdown (in Chrome 75 and later) by storage type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With