HTML over WebSockets: real-time SPAs with barely any JavaScript

https://en.andros.dev/blog/ef4968f5/html-over-websockets-real-time-spas-with-barely-any-javascript/

6 points · 4 comments · view on lemmy.world

4 Comments

mark@programming.dev · 1 pts · 30d (3 replies)

You could get all that without the heavy burden of websockets by just rending HTML on the server (MPA) and using view transitions for a more native-like feel.

In general, I would avoid anything websockets related unless you have a lot of money to scale it. Otherwise, a large amount of traffic connecting via sockets will likely take down your whole site.

yogthos@lemmy.ml · 1 pts · 30d (2 replies)

Yeah, the big issue with websockets is that you have to hold a connection per active client. So there is a scaling concern if you have a big public site. But for a lot of cases where you don't have a ton of active users, ws works fine.

mark@programming.dev · 1 pts · 29d (1 reply)

There are still security holes you'd need to address when clients are connecting. Websockets are helpful when you use them correctly. But they require some work regardless of the size of your site either way. I'd just avoid them if you really don't need them.

yogthos@lemmy.ml · 1 pts · 29d

Yup, agree completely.