Switch to Angular SSR - Add Document Titles & Open Graph Meta Data #127
+292
−122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Research PR for Angular SSR
Deployment: https://pr127.hephaestus.felixdietrich.com/
Performance Test Results
Lighthouse report on localhost
CSR with
npm run serve --prod
on develop-branch:hephaestus_lighthouse_csr.pdf
hephaestus_about_lighthouse_csr.pdf
SSR with
npm run build && npm run serve:ssr:webapp
on PR-branch:hephaestus_lighthouse_ssr.pdf
hephaestus_about_lighthouse_ssr.pdf
Google's PageSpeedInsights (PSI) Test on Coolify
Metrics: Performance - Accessibility - Best Practices - SEO
/
/
/about
/about
Explanation:
Performance values on Desktop devices is pretty similar both CSR and SSR. The largest difference can be seen on mobile devices, where the performance massively improves with SSR. This can be explained by the reduced First Contentful Paint (2.0s with CSR vs. 0.9s with SSR at
/
) and Largest Contentful Paint (3.5s with CSR vs. 0.9s with SSR on/
) and the avoidance of the page layout shift for the leaderboard on SSR.The difference in "Best Practices" stems from CORS errors produced by Keycloak due to the difference in top-level domains.
The improvement in SEO can be attributed to the added meta-tags, which are part of the SSR-branch.
Motivation
Server-Side Rendering (SSR) is a popular alternative to Client-Side Rendering (CSR), mostly attributed with overall improved performance and offers unique features like dynamic SEO. It works by (pre-)rendering content on the server, usually generating static HTML, before sending it to the client. This leads to substantially less transfered data and JS execution on the target device. The largest performance improvements can typically be seen on mobile devices or with low-bandwidth connections. See the Angular docs: https://angular.dev/guide/ssr
Page meta data is considered a really important factor for SEO and allows for a in-line previews when using links on social media (for example Slack).
Description
This PR adds SSR to the Angular
webapp
. SSR is realized by an Angular Express server, which has been automatically generated byng add @angular/ssr
.This PR also adds page-aware document titles and all the required open graph meta tags for seamless link previews on all social media platforms.
Screenshots (if applicable)
Checklist
General
Client (if applicable)
Server (if applicable)