11

Currently looking into various browsers indexeddb limits. Found that Chrome didn't have a hard limit but permissions needed to be given (Source), that Firefox was 50% of local storage (Source) but couldn't find anything for Edge or Safari.

I experimented with Edge and found it didn't have the limit set by IE: 500MB per domain (Source)

Unfortunately navigator.storage.estimate() doesn't work on Edge https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/estimate

Does anyone have any experience with Edge or Safari regarding this?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Sam
  • 794
  • 1
  • 7
  • 26

5 Answers5

10

Microsoft Edge's IndexedDB limit is 20% of the global max, similar to Firefox and Chrome:

It depends on the device and which version of Edge you're using. The latest version is similar (sic) to Chrome/FF and have the following limits per domain - each domain can take up to 20% of the global limit (which is for all domains):

IndexedDB Size Table

Source: https://twitter.com/gregwhitworth/status/1020391736974094336

So how big the db can grow per-domain depends on how big your hard drive volume size is.


Safari's IndexedDB limit is unlimited for Desktop, according to: https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/offline-for-pwa

In mobile Safari, apps can use up to 50MB max, whereas desktop Safari allows unlimited storage (and prompts after 5MB)

However, Safari implemented new IndexedDB limits as first tracked in November 2018:

If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is half the free disk space. - WebKit change tracker

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • Thanks for the answer. As I mentioned in my question, the 500MB limit is for Internet Explorer, not Edge. I tested Edge and was able to save >800MB of random data in Indexeddb without any issues. – Sam Jul 18 '18 at 17:20
  • @Sam across multiple domains or just one? If the former, then the link above is out of date and it would be good to let Microsoft know about that. At any rate I can try to reach out to some folks on the Edge team and see what they say. – TylerH Jul 18 '18 at 18:32
  • just one domain. I was on localhost, and I added entries of ~25MB each until I reached 20 entries. Each entry contained random data. – Sam Jul 18 '18 at 18:35
  • I don't think this is correct for Mobile Safari, see https://trac.webkit.org/changeset/237700/webkit/ – nullability Sep 09 '19 at 20:34
  • @nullability Thanks, I've updated the post to reflect the new implementation on Safari. – TylerH Sep 09 '19 at 20:53
7

Safari seems to be poorly documented at the moment so I thought I'd share my recent experience with Safari mobile (11.4) / IndexedDB storage limitations.

TLDR: 50MB quota does not apply to IndexedDB storage on Safari mobile (11.4)

Initially I thought that there was a 50MB hard limit for combined total of all offline storage methods (Local+Cache+Session+IndexedDB+WebSQL+Cookies).

I am pulling down 180MB of data over the wire and dumping it straight into IndexedDB (browser reports IndexedDB consumption of 98MB - some kind of internal compression going on here) and Safari (mobile 11.4) happily accepts it in IndexedDB.

The 50MB limit seems to apply only to Local / Cache Storage (possibly others), not IndexedDB - I guess volume % quotas apply here.

Side note: don't bother trying to save space in your IndexedDB by compressing content with LZ-string or similar - the browsers internal compression implementation means that it either makes no difference or actually increases the consumption!

steddy_eddie
  • 151
  • 3
  • are you sure that the data was being compressed and not just overwritten? – fgilio Aug 15 '19 at 19:52
  • Awesome, thanks! Here's more information in case someone is interested https://love2dev.com/blog/what-is-the-service-worker-cache-storage-limit/ – fgilio Aug 18 '19 at 00:23
2

As of 19 October 2020 the accepted answer seems to be disprovable by example, since I have just loaded 30G using indexedDB into both Chrome and Edge (latest versions of both). I did so 1G at a time, with hundreds of objects on each iteration, to allow both browsers ample opportunity to object if they elected to do so. They did not.

The data remained persistent and available over restarts of the browsers. According to the accepted answer, I should have been limited to 4G (20% of 20G, since my disk is 500G, or ">128GB").

Eric
  • 180
  • 1
  • 10
1

In Safari for iPadOS 14.5.1, a website can use up to 2 gigabytes for IndexedDB.

Dull Bananas
  • 892
  • 7
  • 29
0

Don't have much to say about SAFARI, but for the MS Edge, the table shown above in the first answer is accurate as per the documentation provided by MS EDGE as well as if you try MS Edge version 38. For the MS Edge version 42 (which I have installed on the ASUS tablet p027) I can confirm that, the limits and restrictions are very much same as the Chrome are for the Cache Storage API. According to MDN https://developer.mozilla.org/en-US/docs/Web/API/StorageQuota , you can query and request storage usage and quota information. This is an experimental technology, but will give you close enough estimates, and this property is supported on the MS EDGE 42 version (atleast on the above stated tab, and i don't have MS edge 42 installed on my machine/desktop/laptop as you can't install/update it without updating Windows itselt!)... Hope this part of information works for you, if you find better information please share with us. Cheers:)


P.S. But for sure Both Safari and Edge have taken it seriously now and is already in their development priorities. Moreover, Safari 12 or over atleast support PWA to a text/images level upto 50mb on mobile but doesn't support videos.

zaffar
  • 679
  • 6
  • 13