Software Development

Is SSR with Angular Universal still relevant with the new Hydration features?

J Asked by James Taylor · 12-02-2024
0 upvotes 5,448 views 0 comments
The question

I've been struggling with SEO for my Angular Single Page Application. I know Angular Universal used to be the go-to for Server-Side Rendering, but with the recent updates in Angular 17/18 regarding "Non-destructive Hydration," I'm confused. Does this replace Universal? If I want to rank high on Google and have fast "Time to Interactive," what is the current best practice for setting up SSR in a modern Angular project? 

3 answers

0
M
Answered on 25-04-2024

It's actually a rebranding and an evolution! "Angular Universal" has been integrated into the core Angular CLI as @angular/ssr. The new "Non-destructive Hydration" is a massive improvement because the browser no longer flickers by destroying and re-creating the DOM when the client-side JS kicks in. For the best SEO, you should definitely enable SSR during your ng new setup or add it later with ng add @angular/ssr. It ensures search engines see your full content immediately while the user gets a smooth transition once the app becomes interactive. 

0
RI
Answered on 28-04-2024

Is there any significant impact on server costs when switching from a standard SPA to full SSR with hydration? 

MA 02-05-2024

There is a slight increase in CPU usage on your server because you're now rendering HTML for every request, Richard. However, for most business use cases, the SEO benefits and the drop in bounce rates due to faster initial loads far outweigh the extra few dollars in hosting. You can also use "Prerendering" (SSG) for static pages to keep costs down while still getting all the SEO "juice" you need.

0
TH
Answered on 05-05-2024

The new @defer blocks are also amazing for performance. Use them alongside SSR to load heavy components only when they enter the viewport. 

JA 06-05-2024

Great point, Thomas! Deferrable views combined with SSR hydration really make Angular feel as fast as a static site.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

World globe icon Country: Canada

Book Free Session