AAV
AAV

Reputation: 808

When server data need to refresh in application

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:

enter image description here

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

Answers (2)

Yeldar Nurpeissov
Yeldar Nurpeissov

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

Ravindra Bagale
Ravindra Bagale

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

Related Questions