I wanted to cache for all API calls, so that app can run while there is no internet. Below are some options i have came across
SQLite
I was thinking about this structure for table
--caches
id : auto incement
url : varchar:unique
body : text
expires_at : timestamp
created_at : timestamp
What you think about this table structure ?
I heard that iOS (app store) is not going to accept this app, since SQLite db wont backup to iCloud? whats the work around to this?
localStorage
or it will be enough to use localStorage for API response caching, But there is limit of 3-5mb for localStorage, that can cause issue, for example. If I have 20 endpoints and all data will be cached, then it will surely cross this limit. and upon updates sometime localStorage get cleared.
Please help what will be prefer way to do this, since I wanted ionic app at least can access all the content which is present in cache.
There are some other options like PouchDB and others which uses browsers IndexDB but in iOS its not well supported.
I will be publishing this app for iOS and Android
Aucun commentaire:
Enregistrer un commentaire