Server-Side Rendering (SSR)

A technique where the initial HTML content is generated on the server for each request rather than in the browser.

  1. When a user requests a page, the server runs the React components
  2. The server generates the full HTML content
  3. Server sends this HTML to the browser displaying the content immediately
  4. React then “hydrates” the page, attaching event handlers and making it interactive

Advantages:


Static Site Generation (SSG)

A technique where the HTML pages are generated at build time, rather than on each request or on the client side.

Great for content that doesn’t change frequently

Fastest loading experience for users.


Client-side Rendering (CSR):