Skip to main content

What is pre-rendering?

Pre-rendering is an approach where HTML pages are generated in advance, during the project build, rather than on the server for every request (as in SSR).


How it works:

  1. During the build of Angular (or another framework)
  2. Finished HTML files for the selected routes are created
  3. These HTML pages are placed into dist/
  4. The server then simply serves static HTML, without Node.js or SSR logic

How pre-render differs from SSR:

SSRPre-render
HTML generationon every requestonce, at build time
ServerNode.js neededcan be served from any static hosting
Suited fordynamic datastatic pages

When pre-render is ideal:

  • Landing pages
  • Blogs and documentation
  • "About us", "Contact", "FAQ" pages
  • E-commerce categories that rarely change

That is, wherever the content does not change every minute.


Advantages:

  • Instant loading (like a regular static site)
  • Excellent SEO, because the HTML is already ready
  • No load on the server, SSR rendering is not done on the fly
  • Works on any hosting (Firebase, GitHub Pages, AWS S3, Netlify...)

Downsides:

  • Not suited for highly dynamic pages
  • Updating the data requires a rebuild and re-prerender

Conclusion:

Pre-rendering is a static version of SSR. Pages are generated in advance, SEO works great, the first screen is fast, and no server is needed.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.