This problem is almost identical to the synchronization one maintain between its code and the database.
Usually, backend code do the same workflow:
- Request database
- Create (hydrate) object from raw data
- Manipulate data
- If needed, update the database.
- On the next request (in the case of a web app), you totally invalidate the hydrated objects you have, an begin from point 1. again, as you recognize the database to be the "upstream" source of the data.
From there, I'd say you have 2 paradigms:
Client - server like Server - database
Client to server sync is pretty much the same, you need to setup some cycle, where you consider that your data are still "fresh", then upon the next "action" of your user, query again the server (as you would do with a database), and create your client objects from there.
Push from server to client
Another solution is to have the server "push" the new object states to the client, as soon as it know they have been updated. Such paradigm is use by new frameworks like Meteor: servers listen to the database, wich emit an event upon every update/insert/etc. Servers then update their internals objects, and transmit the event to clients, which do the same (I'm simplifying for the sake of the answer).
In any case, there's no universal solution that you need to add as a library to your project. Caching is hard, like real hard, and you'll need to integrate the server - client constraints to your code, and handle such cache yourself.