By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,819 Members | 1,459 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,819 IT Pros & Developers. It's quick & easy.

Synchronizing Server & Client Caches

Expert Mod 100+
P: 2,327
What's the best approach to synchronizing a client cache and a server cache.

The client cache is there to reduce network calls.
The server cache is here to reduce database queries.

If there's an update to the server data, what's the best approach to making sure the client cache is up to date?
2 Weeks Ago #1
Share this Question
Share on Google+
3 Replies

Expert Mod 5K+
P: 5,318
what exactly is your setup here? a web-application? when using regular http-requests then you cannot push data to the client - so you can only update the cache there with the next request by transferring the new data. other options are websockets or server side events which basically allow for a persistent connection and let you push data to the client in realtime.
2 Weeks Ago #2

Expert Mod 100+
P: 2,327
It's a server application that will talk to multitude of client applications (web, mobile, desktop, and other services).

The client caches are to help reduce network calls and also localize data for off-line usability.
Seems like the best approach is to have the client be responsible for updating the data.
2 Weeks Ago #3

Expert Mod 5K+
P: 5,318
well - websockets for webclients are pretty easy to implement - for mobile devices probably this should be push notifications - since websocktes might tend to drain the device power. if it wouldn't need to be real time then i would use the normal requests to piggyback the new cache data along with them - yea.
2 Weeks Ago #4

Post your reply

Sign in to post your reply or Sign up for a free account.