NG.IX · Angular 22 practice question
An SSR route legitimately needs to fetch a 3 MB payload using HttpClient with the default fetch backend. How should the developer raise the allowed response size?
Check answer and explanation
Correct answer: Configure maxResponseBodySize in the provideServerRendering options.
Explanation
To permit larger responses during server rendering, configure maxResponseBodySize in the provideServerRendering options so the server allows payloads beyond the default 1 MB cap.
Common trap
Passing a custom maxBodyBytes header on HttpClient.get() seems convenient for per-request overrides, but Angular does not recognize that header for SSR buffering limits. Setting responseSizeLimit inside provideClientHydration is tempting because hydration pairs with SSR, yet this limit is a server-rendering concern configured in provideServerRendering.
Source: Angular docs: Server and hybrid rendering — Configuring the response body size limit
Checked against the cited text on 2026-11-25.