RMinelli
RMinelli

Reputation: 191

Is there anything bigger than HTML5 localStorage?

I'd like to store local data on the client side to speed up page loads of my web-app. I tried with HTML5's localStorage but unfortunately it's too small for my needs. Is there anything bigger?

Upvotes: 5

Views: 2726

Answers (2)

oligofren
oligofren

Reputation: 22923

You have several options, but browser support differs and as such you will need to abstract the differences away from the browser by an extra layer on top of the various browser mechanisms

Local Storage is supported by pretty much everything, and normally stores 5-10MB. IndexedDB is supported by most, but not all desktop browsers and can store lots more data. How much depends on the browser, but expect something like 50MB or unlimited. WebSQL is the only way to go if you aim for iOS and Android browsers, as they don't support indexeddb. You can store up to 50MB there.

Elegant abstraction layers that does all of this for you are many: check out the answers in this thread.

Upvotes: 1

Kenneth Spencer
Kenneth Spencer

Reputation: 1532

If the data is static in nature you might be able to cache some in a .js file or use jsonp instead of local storage.

Otherwise your only option right now is local storage with a storage limit of 5 - 10 megabytes depending on the browser. You might be able to get more out of this by compressing your data with something like this: https://github.com/olle/lz77-kit/blob/master/src/main/js/lz77.js

Upvotes: 0

Related Questions