我正在使用在chrome浏览器上使用pouchDB
和IndexedDB
适配器,我想计算每个IndexedDB数据库的大小。我使用https://github.com/jonnysmith1981/getIndexedDbSize/blob/master/getIndexedDbSize.js中的代码进行计算。
我发现数据库的总大小远大于webkit临时存储的使用量。
下面的屏幕截图是我的应用程序使用的总存储(255MB)。
您将看到有5个存储在IndexedDB
中的数据库。以下输出是每个数据库大小的计算结果。您会发现总大小约为389MB。我想知道为什么它们相差如此之大。哪一个是正确的?
--------- _pouch_products -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 86.7 MB
VM1633:51 - detect-blob-support : 2 B
VM1633:51 - document-store : 92.3 MB
VM1633:51 - local-store : 6.1 KB
VM1633:51 - meta-store : 96 B
VM1633:57 TOTAL: 179.0 MB
--------- _pouch_transactions -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 13.7 KB
VM1633:51 - detect-blob-support : 2 B
VM1633:51 - document-store : 2.2 KB
VM1633:51 - local-store : 4.2 KB
VM1633:51 - meta-store : 96 B
VM1633:57 TOTAL: 20.2 KB
--------- _pouch_products-mrview-4c294f20854f412a71c9e7cf2f9cc58f -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 11.9 MB
VM1633:51 - detect-blob-support : 0 B
VM1633:51 - document-store : 35.3 MB
VM1633:51 - local-store : 15.1 MB
VM1633:51 - meta-store : 136 B
VM1633:57 TOTAL: 62.3 MB
--------- _pouch_products-mrview-fdca57d512425c6ed0f20311a4f8d6d1 -------------
VM1633:51 - attach-seq-store : 0 B
VM1633:51 - attach-store : 0 B
VM1633:51 - by-sequence : 86.2 MB
VM1633:51 - detect-blob-support : 0 B
VM1633:51 - document-store : 44.2 MB
VM1633:51 - local-store : 17.4 MB
VM1633:51 - meta-store : 136 B
VM1633:57 TOTAL: 147.7 MB
--------- _product_alerts -------------
VM1633:57 TOTAL: 0 B