5 ms·
The server is written in JavaScript, yes. But I don’t believe there is any client-side JavaScript
by thidr0 6y ago
The server is written in JavaScript, yes. But I don’t believe there is any client-side JavaScript
- NosyHammock 6y agoYea, the server side is running on Node.js (with Pug template engine), but the client-side doesn't have any JS whatsoever.
- j-krieger 6y agoWhich also means that under heavy load, the server just crashes generating templates for that many users instead of just serving JS and rendering on the client-side. There's a reason we do things like this nowadays.
- oftenwrong 6y agoIn my experience, this is not much of a problem. Server-side rendering is not that expensive, and can easily serve high volumes of users. After all, it has been used for decades, and is in continued use by most major sites. There's no significant performance difference between rendering HTML and rendering JSON. Furthermore, there are easy ways to mitigate the cost of rendering on the server side. For example, on a site like reddit, most of the traffic is probably non-logged-in readers hitting the front page, so... cache the front page. Even for logged-in users, the front page listing only could be cached as rendered, since none of it really needs to be live. If liveness was desirable for only certain elements (e.g. voting buttons), it is possible to sprinkle on client-rendered elements.
- m463 6y agobut... then it would be the thing it's trying not to be.