Any solution for key-value local storage?

Hi all,

I’d like to know is there any solution for key-value local storage in client-side? LocalStorage dose work, but I have large data to read and write, I got this error from browser:

Error: Setting the value of ‘APPNAME’ exceeded the quota.

when executing:

window.localStorage[‘APPNAME’] = angular.toJson(VARIABLE);

Thank you!

Use angular-local-storage. It’s awesome. I’m using it myself and it gracefully falls back to cookies.

And Cordova has a storage plugin as well.

bower install angular-local-storage --save

1 Like

LocalStorage is great, but you said “large data” - I don’t know how large, but you’re limited with LocalStorage to 5mb.

I’ve been using which is fantastic if a little higher-maintenance. It uses an API much like WebSQL but basically creates a SQLite database in the app’s Documents folder.

1 Like

Thanks for your suggestion, it sounds really cool! I’m gonna have a try.

Was too fast with my reply; didn’t notice the ‘large data’ comment. Your SQLite suggestion looks awesome by the way.

The size is around 100mb, not too “large”, maybe it’s not a good idea to store this data in client side. I’m gonna try the Cordova-SQLitePlugin, thanks!

And how about using the File API? Infinite storage. Key is filename, value is contents of the file:-)
Have a look at
In the latest versions it is now possible to address files in a device independent way. A big improvement for cross platform dfevelopment. You can store files at cdvfile://localhost/persistent/path/to/file.
Other interesting plugin is to tranfer big files from remote to your device. Combine this with so you can download zipped content, and unzip it somewhere in local persistent storage.

has anyone tried angular-cache

looks interesting for caching http request or anything else and is back (and sync’d) with localstorage

Angular-cache works really well. I used it for a while. Had some issues with controlling expiration. It’s all configurable though - it just didn’t jive with what I was doing. However, it works great for most cases. Very well designed.]

Also look at ng-storage :

1 Like