3 ms·
Just the fact that it's stateless and therefore may result in a simpler application and infrastructure. But I belive that, in this case, the pros of websocket o
by napsterbr 8y ago
Just the fact that it's stateless and therefore may result in a simpler application and infrastructure. But I belive that, in this case, the pros of websocket outweigh its cons.
That said, I've been working with a middle ground: http 2 + sse. Gives the benefit of simpler infrastructure while not being as inefficient as short/long-polling.
ETA: after using websocket for a while, one of the major downsides is that you can't use most of the http ecosystem. Stuff like cloudflare workers, cloudflare anti-ddos[0], swagger api docs, caching etc. I recently switched to http 2 + sse and do not regret.
[0] - they do support websockets, but at a limited and undisclosed rate (I.e. You don't know how many is too many until they ask you to upgrade your plan).