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

Synchronizing Server & Client Caches

Expert Mod 100+
P: 2,330
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?
Aug 29 '19 #1
Share this Question
Share on Google+
3 Replies

gits
Expert Mod 5K+
P: 5,390
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.
Aug 30 '19 #2

Expert Mod 100+
P: 2,330
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.
Sep 1 '19 #3

gits
Expert Mod 5K+
P: 5,390
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.
Sep 2 '19 #4

Post your reply

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