7

I heard before, that max size of localStorage is 5bm to one domain name, but it's too small for me. Can i increase size if localStorage? I should notice that my app work on just one device - it's a terminal, with chromium.

1

4 Answers 4

6

The value of 5MB is not always true. The local storage size varies from browser to browser (2.5 MB per origin in Google Chrome; 5 MB per origin in Mozilla Firefox, and Opera; 10 MB per storage area in Internet Explorer).

You can get more info about local storage for each browser here. You can also test your browser's local storage here.

If you have a lot of data to store and local storage is not sufficient for you, you can always try Web SQL (available in WebKit and Opera) or IndexedDB (available in all modern decent browsers)

6

For Firefox you cannot change the localStorage quota for a single domain name.

But you can change it for all site by opening about:config and changing the value of dom.storage.default_quota.

(A similarly named key dom.storage.default_site_quota seems to be a legacy setting, unused as of 2021.)

1

Quoting from the Wikipedia article on Web Storage:

Web storage can be viewed simplistically as an improvement on cookies, providing much greater storage capacity (2.5 MB per origin in Google Chrome; 5 MB per origin in Mozilla Firefox, and Opera; 10 MB per storage area in Internet Explorer) and better programmatic interfaces.

And also quoting fron a John Resig article (posted January 2007):

Storage Space

It is implied that, with DOM Storage, you have considerably more storage space than the typical user agent limitations imposed upon Cookies. However, the amount that is provided is not defined in the specification, nor is it meaningfully broadcast by the user agent.

If you look at the Mozilla source code we can see that 5120KB is the default storage size for an entire domain. This gives you considerably more space to work with than a typical 2KB cookie.

However, the size of this storage area can be customized by the user (so a 5MB storage area is not guaranteed, nor is it implied) and the user agent (Opera, for example, may only provide 3MB - but only time will tell.)

1

LocalStorage is not supposed to be the primary form of in-browser storage with HTML5 (IndexDB will eventually come along to provide that), but some apps may want more than the default 5MB LocalStorage provides. Is there a way to expand LocalStorage quotas? No and no.

:-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.