SSR Flashcards
Server Side Rendering
Do Cliente Components run on the server during SSR?
Yes, Client Component renders on client and server, while Server Component just renders on server
Is Window Object available on Server Side?
No
What is the “golden rule” of hydration and SSR?
The very first render should produce the exact same markup on the server that it does on the client
Two common footguns with SSR?
1, Trying to access “browser stuff” on the server
2, Hydration mismatches
What is the “two-pass” strategy
First, we print the generic parts.
Second, when we have the specific information for each part, we do a second pass and fill those details
SSR Flavor - “On-demand SSR”
The HTML is generated per-request
SSR Flavor - “Static Site Generation”
The HMTL is generated for every route when the app is built
SSR Flavor - “Incremental Static Regeneration”
Each route is rendered on-demand for the first request, but the HTML is saved for future requests
What type of rendering strategy is used by Next.js in development mode?
dynamic on-demand SSR
What type of rendering strategy is used by Next.js in production?
Next.js will try ti pick the optimal strategy on a route-by-route basis
Server can stream the response?
Yes
are allowed Server Components to be asynchronous?
Yes