Is 5MB the de facto limit for W3C Web Storage?
Asked Answered
E

3

21

I am looking into using browser sessionStorage for a web application, and was trying to find current information on size limitations. It appears most desktop browsers have imposed a 5MB limit. However, I am not finding many recent articles nor information on the mobile browsers.

The Disk space of the W3C Web Storage specification says "A mostly arbitrary limit of five megabytes per origin is recommended. Implementation feedback is welcome and will be used to update this suggestion in the future."

The QuirksMode HTML5 compatibility page for localstorage has its last major update on 12 June 2009 and only includes data for last years current browsers: IE8, FF 3.5b4, Saf 4, Chrome 2.

According to Introduction to DOM Storage, IE8 "allows Web applications to store nearly 10 MB of user data." Introduction to sessionStorage seems to confirm that "Firefox’s and Safari’s storage limit is 5MB per domain, Internet Explorer’s limit is 10 MB per domain."

Web Storage: easier, more powerful client-side data storage from the Opera developer site states "As of now, most browsers that have implemented Web Storage, including Opera, have placed the storage limit at 5 Mb per domain."

A recent chromium issue (#42740) put a 5mb quota on session storage.

Chapter 5. Client-Side Data Storage from Building iPhone Apps with HTML, CSS, and JavaScript states "At the time of this writing, browser size limits for localStorage and sessionStorage are still in flux."

Question: Based on this info, should I just assume 5MB is the limit or should I spend time testing different browsers? Does anybody know of an existing test suite (a la Browserscope) that would have these results?

Epstein answered 12/7, 2010 at 22:45 Comment(0)
L
7

Assuming that the smallest limit for html5 web storage is 5mb, it would be sensible to go with that answer given what information you have presented, and has been presented about W3C web storage. Do beware that everything is in flux, but I don't think this limit will change drastically.

Lollipop answered 12/7, 2010 at 22:50 Comment(2)
No, depending on character encoding, the limit may be lower, see dev-test.nemikor.comUplift
Yeah as Julien says, it is 2.5Mb in webkit for this reason AFAIK. Ridiculously low!Femininity
M
15

A site with some web storage info http://dev-test.nemikor.com

as you can see the quota's are different for each browser!

Browser support screenshot taken on 27-feb-2017

Moulder answered 20/12, 2012 at 14:43 Comment(0)
L
7

Assuming that the smallest limit for html5 web storage is 5mb, it would be sensible to go with that answer given what information you have presented, and has been presented about W3C web storage. Do beware that everything is in flux, but I don't think this limit will change drastically.

Lollipop answered 12/7, 2010 at 22:50 Comment(2)
No, depending on character encoding, the limit may be lower, see dev-test.nemikor.comUplift
Yeah as Julien says, it is 2.5Mb in webkit for this reason AFAIK. Ridiculously low!Femininity
D
4

I've read from some bug report comments that Chrome stores localStorage data in UTF-16, which effectively doubles the sized used, leaving you with something more like 2.5mb. I think this might also be the case for other webkit browsers as well, if they impose the 5mb limit.

The fact that almost a year after this question was asked it still isn't easy to find the size limits (or even the key/value charset) is crazy.

Disconnection answered 20/4, 2011 at 4:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.