Could you save even more bandwidth by updating static data and letting Cloudflare cache/serve it?
ie: put the batches on disk then have the clients grab it? It would be the equivalent of frame differencing, with the total board state being saved occasionally as a keyframe equivalent.
You're doing that dynamically anyway by sending batches and snapshots to the client.
Using the above you're basically making your game board into an interactive movie that's replaying moves from disk most of the time.
I thought about not pushing snapshot/move data over websockets - one of the systems-y friends I ran my architecture by brought this up while I was speccing the site out.
You can't really put move batches on disk and have clients grab them (afaik), since the set of moves you want to send to an individual client depends on their position (and you don't want to send every move to every client).
But you could do this by not sending move batches at all, and instead having clients poll for the entire current state of the board.
The thing is, for them to get realtime-ish move updates they'd have to poll constantly. Cloudflare also has a min TTL of 1 second so there'd be more latency, and also if I screwed something up or saw more cache misses than anticipated I could end up unintentionally hammering my server.
Also if I'd had 100x more traffic (which would be crazy and well beyond what I prepared for!) I think I'd owe like $95 or so for bandwidth with my current setup. So the benefits to reducing bandwidth even more were a little marginal!
WebSockets with binary frames would likely be more efficient than HTTP polling for this use case, giving you real-time updates with less overhead than repeatedly fetching from disk via CDN.
ie: put the batches on disk then have the clients grab it? It would be the equivalent of frame differencing, with the total board state being saved occasionally as a keyframe equivalent.
You're doing that dynamically anyway by sending batches and snapshots to the client.
Using the above you're basically making your game board into an interactive movie that's replaying moves from disk most of the time.