Skip to content
BENIBIX Learn

Static Site Generation vs Server-Side Rendering

Both send ready-made HTML. Static site generation builds each page once, ahead of time. Server rendering builds it again for each visit, so it can show fresh data.

Development🌐 Web Development

Static Site Generation (SSG)

Pages are built as HTML files ahead of time. Then no one has to wait.

Static site generation builds each page as an HTML file ahead of time. This happens before anyone visits. A build step reads the content and templates and writes out the files. The server then just hands out those files, which is very fast and cheap. When the content changes, you run the build again. It suits blogs, docs and any page that is the same for everyone.

Example
Jack's docs site has 300 pages. A build turns them into HTML files in 20 seconds, and the host serves them for free.
Why it matters
Pre-built pages are the fastest and cheapest to serve. Nothing can break at request time.
Full entry
Development🌐 Web Development

Server-Side Rendering (SSR)

The server builds the full page for each visit. It arrives ready to show.

Server-side rendering means the server builds the full page for each visit. It sends HTML that is ready to show. The user sees content at once, before any JavaScript runs. Search engines can read the page with ease too. The cost is more work on the server each time. Many new frameworks mix it with browser code, in a step called hydration.

Example
Emma's news site renders each article on the server. Readers on slow phones see the text in under a second.
Why it matters
SSR shows content fast and is easy for search engines. That matters for shops and news.
Full entry

In one line

Static Site Generation (SSG)
Pages are built as HTML files ahead of time. Then no one has to wait.
Server-Side Rendering (SSR)
The server builds the full page for each visit. It arrives ready to show.