Challenge 3: Choose Between SSR and CSR for LCP — Possible Solution ==================================================================== SCENARIO: A marketing landing page showing only a hero headline and image, with no personalization. RECOMMENDATION: Server-Side Rendering (or static generation) JUSTIFICATION (using the chapter's causes section) ------------------------------------------------------- The chapter explicitly lists client-side rendering as one of the four common causes of poor LCP: "if the LCP element only appears after a JS bundle downloads, parses, executes, fetches data, and renders, that critical path is far longer than server-rendered HTML with the image already in the initial markup." This page is close to a textbook case for exactly that problem being entirely avoidable: - No personalization needed: the chapter's CSR-causes-slow-LCP problem is worst specifically when content has to be FETCHED via an API call after the JS bundle executes, before anything can render. Since this page has no personalization (nothing that needs to be looked up per-visitor), there's no actual reason the headline and image content can't be baked directly into the initial HTML at build time or request time — there's no dynamic data dependency forcing a client-side fetch-then-render step at all. - The content IS the LCP element: the headline and hero image aren't secondary content sitting below some other more important element — they're very likely the actual LCP candidates themselves, per this chapter's "what counts as largest content" section. Rendering them server-side means the image reference and headline text are already present in the HTML the browser receives, letting the browser start fetching/painting them immediately rather than waiting for JS execution to insert them into the DOM first. - This directly avoids the chapter's own described critical path problem: "JS bundle downloads + parses + executes + fetches data + renders" becomes simply "server sends HTML with the image reference already in the markup" — several entire steps of that critical path are eliminated outright, rather than merely optimized. WHY THIS WORKS AS A DECISION -------------------------------- This is a case where CSR's typical justification — needing rich, interactive, per-user client-side logic — simply doesn't apply: a static marketing page with no personalization gains nothing from client-side rendering that would offset the LCP cost the chapter specifically warns is one of the most direct causes of poor LCP scores.