Angular SSR renders your page for every visitor. Here is what that costs.
Angular SSR renders your page on the server, which is the whole point. It renders it again for the next visitor, and again for the one after that, and it ships nothing to stop that happening. On a page of mine, a 28 KB Angular 22 document, a render costs 17.2 ms of server time. That is not a disaster. It is also entirely wasted when a hundred people ask for the same page in the same minute and…
Angular Server-Side Rendering (SSR) renders the page on the server for every visitor, which incurs a cost. For a 28 KB Angular 22 document, rendering takes 17.2 ms of server time. This cost is wasted when multiple users request the same page within a minute, as the rendered HTML remains unchanged. To address this, the ng-ssr-caching middleware was created.
It keeps the rendered HTML and serves it without rendering again. The cache integration involves setting an Entry object containing the body, ETag, and length, then using these values to set the ETag and Content-Length headers and end the response with the cached body. This approach reduces the server workload and speeds up response times.
The key takeaway is that caching reduces server workload but introduces shared cache security considerations.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written; read the original for the full account.



