klnusbaum / UDJ-Server

The Social Music Player!
www.udjplayer.com
GNU General Public License v2.0
43 stars 17 forks source link

Send Queue Hash when Server is Polled for Queue #48

Open jtfairbank opened 11 years ago

jtfairbank commented 11 years ago

Currently, when the server is polled for the current queue, it responds with the entire list of songs in the queue. This is costly for the server and the client (over longer periods of time) due to the required polling frequency (around every 2 seconds).

Instead of sending the whole queue, just send a hash of the queue. The client can then check if the previous hash it received and this hash are different- if not, don't do anything. If they are different, at that point the client should make a separate request to get the the full queue data.

Future future request: accept a hash from the client and send the client a delta of what's changed, so it only has to make those changes locally (ie shuffle songs around or insert a new song) rather than rebuild the queue.

klnusbaum commented 11 years ago

This is an interesting solution to our current polling problem. That said, I feel like the real solution is long polling. I think we should try to figure that out first. With long polling this kind of fancy foot work becomes completely unnecessary.