What is server-side rendering (SSR), and why would you use it?

Angular performance and SSR · Freshers and experienced

Model answer

With SSR, a Node server renders the Angular app to HTML for the first request, so the browser and search engines receive real content immediately, and then Angular takes over in the browser (hydration). Benefits: faster first paint, better SEO and sharing previews. Costs: a server to run, more complexity, and code must not use browser-only objects such as window or localStorage on the server without checks.

Pages behind a login usually do not need SSR. Public content pages do.

Tips

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions