Ron B
Ron B

Reputation: 21

does browser local storage share space with indexeddb,

if I store data in both locations will the size of counted for both as 1, or are they separate.. so example if store 10 MB in local, and 5 in indexdDB on the phone will is complain I am out of space?

Upvotes: 0

Views: 222

Answers (1)

Joshua Bell
Joshua Bell

Reputation: 8365

This depends on the browser.

In current versions of Chrome (this could change!), localStorage is not accounted for in the quota system, and each origin has a fixed 10MB cap. Other storage types (Indexed DB, Cache Storage, etc) share the dynamically calculated quota assigned to each origin (currently something like 6% of disk size, but varies across OS/device types). So localStorage and Indexed DB do not compete. But that's just Chrome. Other browsers may do things differently.

Firefox and Chrome both offer a navigator.storage.estimate() method which lets you inspect usage and quota by an origin; you could use this to determine if a particular storage mechanism is reflected in that browser's quota system.

Upvotes: 3

Related Questions