skip to content

An online store's product page moved from client rendering to per-request server rendering: LCP fell from 3.8 s to 2.3 s, but TTFB rose from 0.2 s to 1.1 s. Is that a good trade, and what next?

level: seniorimportance: should knowfreq 46%

answer

  1. which number do shoppers feel
  2. the server waits for data before byte one
  3. the first response now carries the content
  4. TTFB is a supporting metric
  5. shared content can come from a stored copy

basics

~20 s

Mostly yes: LCP is what shoppers feel and TTFB is not a Core Web Vital, but 1.1 s leaves little margin under the 2.5 s LCP target. Shared product HTML should be prerendered and regenerated to win both.

solid answer

~50 s

Rendering on the server waits for data and the render before the first byte, which can raise TTFB, but the first response now carries the product, so the largest paint comes forward; under client rendering the content waited behind script, a data call and late image discovery. TTFB guidance calls 0.8 s or less good and over 1.8 s poor, as a rough guide, and TTFB is not a Core Web Vital. So the trade is good, but 2.3 s sits just inside the 2.5 s LCP target at the 75th percentile, and every view now costs server work. Product content does not vary per visitor, so prerendered HTML regenerated on change and served from a CDN gives a fast first byte and early content. Anything that must stay request-time is kept out of the shared HTML or streamed after the top of the page.

go deeper

for a junior

Remember that TTFB is when the first byte arrives and LCP is when the largest content paints, and that one can get worse while the other gets better.

for a middle

Walk through the client and server timelines and show where the product data, the script and the image sit in each, so the opposite movement of the two numbers makes sense.

for a senior

Judge the trade against the 2.5 s target and its margin, see that shared content makes a regenerated stored copy win both numbers, and keep volatile parts from dragging the page back to request time.

for a principal

Set per-page-type latency targets in field data and decide which pages may spend first-byte time for content, rather than optimising either metric in isolation.

## The two metrics - **TTFB (time to first byte)** - the time from starting the navigation to receiving the first byte of the HTML response. Published guidance calls **0.8 s or less good** and **more than 1.8 s poor**, describes the threshold as a **rough guide**, and notes that TTFB is **not a Core Web Vital**. - **LCP (Largest Contentful Paint)** - when the largest image or text block in the viewport is painted. It *is* a Core Web Vital; the target is **2.5 s or less at the 75th percentile** of page loads. TTFB is the start of LCP's timeline, so a higher TTFB eats into the LCP budget. But it is not the whole timeline, which is why the two can move in opposite directions. ## Why the numbers moved apart Under **client rendering** the sequence was: 1. The server answers at once with a nearly empty document - a fast first byte. 2. The browser downloads and runs the application script. 3. The script calls the product API and waits for it. 4. Only then does it build the page and discover the product image. 5. The image downloads and paints - that is the LCP. Under **per-request server rendering**: 1. The server reads the product data and renders HTML before replying - a slower first byte. 2. The response already contains the text and the image tag, so the browser finds the image immediately. 3. The image paints without waiting for the application script. Rendering guidance says exactly this: server rendering can raise TTFB because generating pages takes time, yet a server-rendered page that needs less client work can show content sooner than a fully client-rendered one. "Can" matters - a slow data source decides how high TTFB goes. ## Reading the result - **The trade is favourable.** LCP is the metric the business targets and shoppers feel; it moved from failing to passing. - **The margin is thin.** At 2.3 s the page is 0.2 s inside the target, and a slower product API or a traffic spike pushes it out. - **The cost moved to the server.** Every view now pays a render and data reads, so cost and TTFB grow with traffic. - **Interactivity did not necessarily improve.** If the page still ships and runs the full application script, the shopper can see a page that does not yet respond. ## Options for the next step | Mode | First byte | Largest paint | Main cost | |---|---|---|---| | Client rendering (before) | fast, nearly empty | late: script, then data, then image | script weight, fragile indexing | | Server per request (now) | slower: waits for data | early: content in the response | server work per view | | Prerendered and regenerated, from a CDN | fast | early | build step, staleness window | | Server per request, streamed | the top of the page leaves early | early if the LCP element is near the top | server work; status fixed at first flush | ## Choosing for this page - **Product content is the same for every visitor**, so the default is prerendered HTML regenerated when the product changes, served from a CDN. It is the one row that wins both first byte and largest paint. - **Per-visitor or volatile parts** - recommendations, a "recently viewed" strip, a live stock badge - load in the browser or are confirmed at add-to-cart, so they do not force the whole page back to request time. - **If the page must stay request-time**, for example because price is negotiated per account, keep it on the server and make sure the slow part is not in front of the largest element: stream the top of the page and the hero image before the slow region. - **Measure in the field** at the 75th percentile for each page type, not only on a fast laptop. ## Pitfalls - Treating any TTFB rise as a regression ignores that TTFB is a supporting metric. - Assuming server rendering always lowers TTFB confuses "less work in the browser" with "less work before the first byte". - Celebrating LCP while the hydration script still blocks the first tap trades one problem for another.

  • Product prices differ by the shopper's country. Does that rule out prerendering the product page?
    Not by itself. A handful of countries is a handful of variants: prerender one copy per country and route each request to its variant, and the page stays shared within each country. It rules prerendering out only when the price is per shopper, such as negotiated trade pricing; then render the price per request or fill it in the browser, and keep the rest of the page shared.
  • When would you accept a higher TTFB on purpose?
    When the page's main content genuinely depends on the request - per-account prices, live inventory that must be exact - and the alternative is client rendering. Rendering on the server costs first-byte time, but it delivers the content in one trip instead of three, which usually brings the largest paint forward. The TTFB guidance itself says to weigh it against how the site delivers its core content.

  • TTFB is a Core Web Vital, so any rise is a failing regression
  • Server rendering always lowers TTFB because the browser does less
  • A better LCP means the page now responds to taps sooner too
  • Per-request rendering is the only way to put content in the first response
  • Client rendering wins LCP because its first byte is fastest