๐—ฆ๐—ฆ๐—ฅ, ๐—–๐—ฆ๐—ฅ, ๐—ฆ๐—ฆ๐—š, ๐—œ๐—ฆ๐—ฅ: ๐—ช๐—ต๐—ฎ๐˜ ๐—”๐—ฐ๐˜๐˜‚๐—ฎ๐—น๐—น๐˜† ๐— ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐˜€

A senior developer once asked me which rendering strategy I would use. I answered SSR with zero confidence. I knew the acronyms, but I did not understand the tradeoffs.

Every strategy answers one question: When and where does your HTML get built?

๐—ฆ๐—ฆ๐—ฅ (Server Side Rendering) The server builds HTML fresh for every request.

๐—–๐—ฆ๐—ฅ (Client Side Rendering) The browser builds the page after downloading JavaScript.

๐—ฆ๐—ฆ๐—š (Static Site Generation) You build every page once at deploy time.

๐—œ๐—ฆ๐—ฅ (Incremental Static Regeneration) This gives you SSG speed with fresh data.

๐—ง๐—ต๐—ฒ ๐—ฆ๐—บ๐—ฎ๐—ฟ๐˜ ๐— ๐—ผ๐˜ƒ๐—ฒ Do not use one strategy for your entire app. Match the page to the data.

An e-commerce example:

Stop thinking about framework choices. Start thinking about data. How often does it change? Who sees it? How bad is it if the data is 10 minutes old?

Answer those questions and the right strategy picks itself.

Source: https://dev.to/alaa-samy/ssr-csr-ssg-isr-i-was-confused-too-heres-what-actually-matters-305f