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:
- During the build of Angular (or another framework)
- Finished HTML files for the selected routes are created
- These HTML pages are placed into
dist/ - The server then simply serves static HTML, without Node.js or SSR logic
How pre-render differs from SSR:
| SSR | Pre-render | |
|---|---|---|
| HTML generation | on every request | once, at build time |
| Server | Node.js needed | can be served from any static hosting |
| Suited for | dynamic data | static 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 readyPremium
A concise answer to help you respond confidently on this topic during an interview.