Reputation: 5020
I'm working on an AngularJS based mobile app using Cordova and required to persist data locally.
I see Cordova offers an API to local storage via window.localStorage, but I have a bunch of unclear questions:
Is this storage flushed or cleared at some time (i.e. on mobile low space) or is it persistent guarantied?
In addition, is IndexedDB subject to space limits too like localStorage?
Thanks.
Upvotes: 1
Views: 758
Reputation:
The Cordova docs
localStorage, Provides access to the W3C's Web Storage interface
.
So window.localStorage
=== HTML5 localStorage
.
The w3c Web sotrage interface says
This specification defines an API for persistent data storage of key-value pair data in Web clients.
So yes, it should be persistent (and not flushed away after x time), but you have to check up which each vendor you want to support, how they handle low-memory, limits, flushing (if any)..
IndexedDB space limit is also vendor specific, but it is never unlimited (then it would be pretty easy to fill your memory .. )
Upvotes: 1