Reduce, Reuse, Recycle - Persisting WebSocket connections with SharedWorkers

A presentation at DjangoCon Europe 2019 in in Copenhagen, Denmark by Aaron Bassett

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


Buzz and feedback

Here’s what was said about this presentation on social media.