Reputation: 7613
In app, on first screen, client app calls api request and save them into db(coredata), whenever app launches first time. Next time onwards app shows content from db, rather then making request.
I am thinking....Can we use background tasks or background fetch to improve app performance even more..?
is this optimisation is good ?
suppose user has launched an app, application loads first 50 data and saved into db. now whenever user minimize app, we can start making http requests in background and collect more data periodically. so next time whenever user maximize an app he/she can see 300 data. (assuming that we had made 5 more requests when app was in background and saved into db)
Upvotes: 0
Views: 38
Reputation: 702
What I have sometimes done is making the request as part of the build steps of the app and include the database in the bundle already with data populated.
Then on the first use of app, when the user has just downloaded from the app store, it already has some data ready to be used.
Once the app is running you can request an updated version of the data using a background task as you are already proposing.
Upvotes: 1