Reputation: 808
After fetching data from server we can store that in DataBase
and use that again and again and refresh data if that modified in server like this diagram:
BUT how to found out about server data need to refresh in app without request again?
note : I found some solution like push
model but i think HTTP
in rest api
can resolve this problem, something like @HEAD
or etc.
Upvotes: 0
Views: 456
Reputation: 2296
You have no guarantee that the push will be received
The first solution: you need a hash or timestamp. When there is new data on your server, it will update this hash or timestamp. Then you need to check if this hash or timestamp matches. If not, you need to update the data..
Upvotes: 1
Reputation: 17655
You have to use Push Technology , in which server side sends info when it has new updated info..
in other words we can say "publish and subscribe" model..
Upvotes: 1