Caching in Ionic app?

Helloy guys,

I was wondering what is best practice for caching in an Ionic app. I am using Vuex for state management with plugin which allows Vuex to be persisted in local storage and rehydrates Vuex whenever app is reloaded. Is this okay to use for caching (storing in local storage and reading it when page is refreshed) or should I use filesystem or even something else?

What is most performant and best practice?

I am using only native (android and ios) apps.


If you are able to use native features, I would go for a filesystem approach, given size and persistence across platforms. IndexedDB is cool, but iOS can be a bit strange about data storage in web (indexeddb, localstorage etc - cleaning the database after a time of inactivity etc.)

As to performance, you may want to split it over both, although loading data from native shouldn’t be an issue right? As long as you don’t need to load Gigabytes upon app-start…

1 Like

Thank you for response. That is not that huge so it wont be a problem.

Of course, the Ionic answer is Ionic Storage with sqlLite driver. Specially if the data isn’t huge and/or structured in JSON

1 Like