Privacy

A website responds slowly before anything loads: break down TTFB

TTFB includes more than application processing. Follow the actual navigation through redirects, network setup and the origin response, then compare the same conditions before choosing a repair.

Made by Pagember · Editorial policy

Primary sources + editorial analysisPublished Updated Sources

The short answer

TTFB covers more than server time, since redirects, DNS, connection and TLS setup and request waiting all count. Measure the real entry journey, such as an old link that redirects several times, and compare it with the final URL under consistent cache, login and network conditions. A curl timing breakdown or the DevTools Timing tab shows which phase to fix before you change the origin or buy capacity.

On this page8 sections

A slow first response does not automatically mean the application server is slow. TTFB can include redirects, connection setup and waiting for the response. Follow the actual entry journey, then use timing evidence to identify which phase deserves attention. Image compression cannot remove a delay that occurs before the document begins arriving.

A navigation timeline separates redirect, DNS and connection phases from origin waiting before the first response marker.

Consider a workshop site reached through an old newsletter URL. The reader follows a redirect to HTTPS, another to the preferred hostname and another to the current path. A developer testing only the final address sees a faster result. Neither observation is necessarily wrong; they measure different journeys.

Define what the reported number includes

web.dev’s TTFB explanation describes elapsed navigation time until the first response bytes, including redirects, service-worker startup where applicable, DNS, connection and TLS setup, and request waiting. TTFB is not itself a Core Web Vital, although it affects when later page work can begin.

Record the tool, metric definition, initial URL and final URL. A label such as server response time may measure only part of the navigation. Avoid comparing two tools’ numbers as if they necessarily start and stop at the same events.

curl gives a quick phase breakdown from the command line. -L follows the redirects, and each value is the cumulative time in seconds from the start of the request:

curl -sL -o /dev/null -w 'redirects: %{num_redirects} (%{time_redirect}s)\ndns: %{time_namelookup}s\nconnect: %{time_connect}s\ntls: %{time_appconnect}s\nfirst byte: %{time_starttransfer}s\ntotal: %{time_total}s\n' https://www.example.org/old-newsletter-link

Run it once with the old entry URL and once with the final URL. A large time_redirect points to the redirect chain. A large gap between tls and first byte on the final URL is time the server spent preparing the response. The curl manual lists every timing variable. In Chrome DevTools, the Network panel's Timing tab shows the same phases for a single request, with request waiting labeled "Waiting for server response".

For the workshop, keep one observation beginning at the newsletter URL and another beginning at the final page. That comparison can identify avoidable entry overhead without falsely claiming the origin generated HTML faster.

Preserve the conditions of each observation

Record login state, location, network, browser, cache condition and navigation type. A repeat load can reuse connections or cached content. An authenticated page may legitimately bypass a public page cache. These are different workloads.

MDN’s navigation-timing reference describes the current document’s navigation entry and properties including navigation type. It inherits resource-timing properties. Inspect the browser’s actual timeline and supported fields rather than assuming every duration is available or represents new network work.

Repeat a small set of equivalent observations and retain variation. One fast result after a slow first request does not establish a durable improvement. Likewise, a deliberately cold test should not be presented as the normal experience of every visitor.

Phase or comparisonQuestionPotential owner
Initial URL versus final URLHow much entry redirection occurs?Link publisher and routing configuration
DNS and connection setupIs connection establishment dominant?Network path and delivery architecture
Request waitingWhich server-side work or dependency delays response?Application and hosting maintainers
First bytes versus meaningful pageDoes substantial delay remain after response starts?Streaming, resource delivery and rendering

Follow redirects from the actual entry point

Inspect the chain and its reasons. A necessary HTTPS upgrade and an avoidable obsolete-path detour deserve different decisions. When authorized, updating the source newsletter or internal link to the intended secure destination may remove future detours without changing old-link compatibility.

Do not delete useful redirects indiscriminately to improve a number. Existing bookmarks and external references may need them. Review whether the same intended destination can be reached through fewer deliberate steps while preserving correct old URLs.

For the hypothetical site, comparing the old newsletter link with a current direct link produces a concrete routing question. It does not yet establish whether DNS, the origin or a database query is slow.

Break down connection setup before blaming page code

Look at the browser’s DNS, connection and TLS phases. A distant or unstable network path can affect a visitor even when the application’s processing time is modest. Reused connections can make a later request look very different.

Compare relevant audience conditions where you have authorized evidence. Do not claim that one test location represents all readers or that adding a CDN universally fixes an authenticated dynamic workload. Identify what can be cached and which request still reaches the origin.

The WordPress performance triage guide covers broader resource and application questions. This investigation should first establish whether the delay is in setup, response preparation or later work.

Use backend timings with a defined scope

MDN documents Server-Timing for named response metrics, including backend durations visible through browser tools. It also warns that metrics can expose sensitive infrastructure information. Use reviewed instrumentation and safe names, with appropriate visibility.

A database duration, template-render duration and remote-API duration can help locate work. They do not automatically add up to the complete browser TTFB: some work can overlap or be uninstrumented, and network setup sits elsewhere.

For the workshop, if request waiting is high but the recorded database stage is small, do not add an index merely because the page uses a database. Inspect the remaining application boundary. The query diagnosis workflow applies when evidence actually implicates that workload.

When the evidence shows server preparation time dominating on uncached pages, and the plugins and queries have been reviewed, the hosting plan becomes a fair question. Managed hosts such as Kinsta include server-level page caching and an application performance tool for tracing slow PHP and database work, and a managed VPS such as ScalaHosting gives the site dedicated CPU and memory instead of shared resources. Keep your phase measurements so you can repeat the same journey after any move.

Check what first bytes mean for this platform

Early Hints or an early partial response can make responseStart occur before the final document response or useful content. web.dev explicitly discusses this distinction. Where supported, finalResponseHeadersStart can help distinguish the final response boundary, but tool support and interpretation need checking.

Do not improve a reported TTFB by sending an early empty shell while leaving the reader waiting just as long. Record when meaningful content becomes available as a separate observation. A low first-byte number is useful evidence, not a complete statement that the page is fast.

If a repeat navigation uses a cached response or conditional validation, keep that exchange visible. A 304 Not Modified answer means the browser asked the server to confirm its stored copy, so that request still pays for the connection and the server's check even though no page body is sent. A response served straight from the browser cache makes no request at all. Record which of the two happened before comparing repeat-visit timings.

Keep the affected percentile or observation range explicit when using audience data. A median can hide a slow group of readers, while one worst case can exaggerate ordinary performance. Describe the sample and conditions the existing measurement supports, and avoid turning a limited lab run into a claim about every visitor.

Choose one explained correction and repeat the same journey

  1. Retain the original entry URL and timing conditions.
  2. Identify the dominant phase and its responsible component.
  3. State the proposed correction and the result it should change.
  4. Rehearse on an authorized environment where possible.
  5. Compare equivalent cold and warm conditions separately.
  6. Check correct content, access behavior and later page usability.

Accept a timing improvement only within the conditions actually observed. Your next step is a phase-level evidence sheet: original entry, redirect chain, setup, request waiting and meaningful-content boundary. That supports a targeted repair instead of a hosting purchase based on one undifferentiated number.