Hacker News new | ask | show | jobs
by enlyth 2276 days ago
Depends on what you're building. Client side rendering vs SSR have both different trade-offs and performance implications, and it's best to evaluate which is better for your use case.

For a blog or mostly static webpage? SSR is probably the better choice. But there are many times where serving a minified React bundle to the client and letting it do all of the rendering work is better. It's actually a much lower strain on your server, because all you're doing is serving static files from behind a proxy like Nginx, whereas with NextJS your server incurs significant performance overhead from having to evaluate each page view in JS. Imagine this for a million visitors at once when you have content that cannot be statically cached.

1 comments

why couldn't you cache it?
Because it could be personalized content that differs for each request/user.
You could take a mixed approach. Server render non-stateful stuff, restrict user state to client-side only. You can then CDN cache the public stuff.
Which is the reasonable way to do it. However, uncacheable things might remain.
Uncacheable things are always reserved to the client side only