Reduce, Reuse, Recycle - Persisting WebSocket connections with SharedWorkers

By Aaron Bassett, at Djangocon Europe 2019, on Do 11 April 2019
Sketchnote of Reduce, Reuse, Recycle - Persisting WebSocket connections with SharedWorkers

When using WebSockets to communicate between your server and the client every new browser context–tab, window, iframe, and so on–is likely to create another WebSocket connection. All these open connections can quickly take a toll on your server resources, or if you’re using a PaaS which charges for each connection, it could quickly add up to a big bill.

In this talk, we’ll look at how you can use SharedWorkers to create a single persistent WebSocket which can be used by every browser context to communicate with your Django Channels WebSocket server