Best way to speedup websockets
i write node.js application with websockets based on sockjs and i need to make minimal update time on client.
Events in application occur every Nms (e.g. 20ms) and i need make broadcast changes to users as fast as i can.
Every update is 100-200 bytes. Ping to sever is 90-200ms.
If i Send Message every time event happened - there is some lags on client app and.. It's bad idea by design.
If i Send message every Nms (e.g 200ms) - updates on client looks more smooth, but there is too many "frame drops"
Is this good idea to mix this methods and send
Maybe i need to make "no-necessarily" updates which will owerwrite if "second" update will come earlier than "first", because ping.. And how to "drop frame" if there is heap of updates on client.
What's the best way to broadcast updates to user? Thanks.
Only one thing I can recommend, it's look at the source code of meteor.js They use latency compensation and SockJS.