LocalForage size limit for an Ionic Mobile App

ⅰ亾dé卋堺 提交于 2020-01-04 02:27:30

问题


I'm building a mobile App using Ionic framework. My app heavily uses offline database. My first attempt was to use ngStorage which uses localStorage but after a while i hit the size quota limit which is about 5MB. So i took a look at angular-localForage , In there it says:

Store your data in the best available storage solution that your browser can offer (IndexedDB / WebSQL or localstorage as a fallback)

Now for my multi-platform Mobile App does it mean it's going to use IndexedDB which has a higher size limit in regards of storing data? Or will it use localStorage and i'm back to square one?

If it's IndexedDB, is there any documentation on how much actual data my Mobile App can store?

It would be splendid if localForage takes care of size limit because the way it stores the data is perfectly fit for my application but I'd like to know if someone has used localForage in their app without worrying about their database size hitting a limit.

I'm also open to any alternatives except relational sqlite because i want an object-oriented approach. (PouchDB as an example)


回答1:


Add this plugin to your app and use PouchDB. PouchDB will use the native sqlite storage, which can store upto 1 GB of data. You can read more about this here. under heading "SQLite plugin for Cordova/PhoneGap"

http://ngcordova.com/docs/plugins/sqlite/



来源:https://stackoverflow.com/questions/32406730/localforage-size-limit-for-an-ionic-mobile-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!