in a blog with infinite scroll, client side will query server for posts
example max_id = 0, min_id=0. server will answer with latest 30 record [id:1000,999,998 etc..,970]
.
now next request from client will ask for max_id=1000&min_id=970
, server will answer with 30 more posts that has ids > 1000 or lesser than 970. if there is no newer posts that 1000, then normal reply will be id 970-940.
this is implemented in an infinite scroll. problem is.. and all posts are saved client side for offline-caching.
now next time user open app, it will show posts max_id=1000&min_id=930
and will get any new posts or fetch more older posts, but **there is no way it can detect a change in one of the posts that it already have in client side. **
say post id=999 was updated by user. only way to get this update would be to requery server for all posts as if there is no cached posts. i feel that this is a waste of band since 99% of times there will be no updates, so there was no need for this over fetching.
is there a design pattern that tackle this point in offline-first applications ?
Aucun commentaire:
Enregistrer un commentaire