Reputation: 8880
From what I can understand Chrome imposes a "soft" limit of 5Mb on the size of data stored in localStorage and IndexedDB. There are a number of things here that are not clear to me
Compression would come at the cost of loosing the benefits of being able seamlessly to store/fetch JSON in IndexedDB (though this can be made transparent to my app with little extra effort).
I'd much appreciate any guidelines with these issues.
Upvotes: 3
Views: 7819
Reputation: 8880
I wrote up a fiddle to examine what happens when the soft storage limits are breached - and also to test the utility of compressing what gets stored. Here is the fiddle
I have used the compression routines here for the test. The actual compression is easily done
var compr = LZString.compress(uncompr);
Notes
Upvotes: 1
Reputation: 862
Here are the listed answers of your doubts:
When the localStorage reaches 5MB Google Chrome produces an error in the javascript console log:
Uncaught Error: QUOTA_EXCEEDED_ERR: DOM Exception 22
I haven't tried compression with locallStorage, so no idea about that.
Upvotes: 2