How to keep app config with best practice


#1

Hi It is my very fist post on ionicframework as a newbies.

I want to ask about app configuration and storage. How should I store info of app configuration such as user login/logout, ispalyed_demo, language and some other info? What should I use - localstorage, cache or sqlite?

When should localstorage be used, when for cache and when for sqlite? advantage and disadvantage over each others, please.

I search on google but not found in detail comparisons.

Any tutorial about app configuration is very appreciate and thankful.

Thank.


#2

Localstorage has at least a few mb of storage.
You should use it only for flags, e.g. if logged in or the userId or the Session.

With Sql-Lite you are only limited by the devices space. It is a very good approach if you want to provide something like offline-functionalities in your app… so you have to store huge data sets.

In my opinion the real browser cache is only a thing for a faster usage of the app… (shorter loading times of images and templates).

The ionic view cache and the connected ionicView events (if correct used) are good for speeding up page transitions and giving the user a more native app feelling (remember scroll positions and so on).