Websites, applications and hosting for your business.
Recommended Services
Supported Scripts
Mr. Stig measures successive network stages leading to the arrival of the first byte.

Your site takes too long to start responding, and a hosting upgrade is often the first suggestion. It may be justified. Before adding resources, however, you need to identify where the request is waiting. Slow TTFB describes the outcome of a journey; it does not identify the responsible stage by itself.

Name resolution, connection setup, TLS negotiation and waiting for a response all happen before the first byte. Treating them as one problem can lead you to change servers when the largest delay occurs before the request reaches the application. You can also improve one metric while response completion remains slow. A small measurement with clear conditions helps you choose a useful next test.

The first byte is not PHP execution time

Time to First Byte measures the wait until the response starts arriving. It is not a stopwatch exclusively for PHP, WordPress or database work. Distance from the server and connection setup also affect what the client observes.

You also need to know what was measured. Did the final destination respond, or was it a redirect? Was content served from cache? Was the connection new? A browser can reuse connections and maintain its own cache. The following test establishes a simpler baseline; it does not reproduce an entire user visit.

A GET measurement with separate milestones

With curl installed, create a file named timing.txt containing the following. Times are reported in seconds:

status=%{http_code}\n
dns=%{time_namelookup}\n
connect=%{time_connect}\n
tls=%{time_appconnect}\n
ready=%{time_pretransfer}\n
first_byte=%{time_starttransfer}\n
total=%{time_total}\n

In Bash on Linux or macOS, run this from the same directory:

curl --http1.1 --silent --show-error \
  --connect-timeout 10 --max-time 30 \
  --output /dev/null --write-out @timing.txt \
  https://example.com/

In Windows PowerShell, use the actual curl.exe executable and NUL as the body destination:

curl.exe --http1.1 --silent --show-error `
  --connect-timeout 10 --max-time 30 `
  --output NUL --write-out '@timing.txt' `
  https://example.com/

Replace the example with a URL you control. The body is downloaded and discarded so that this remains a GET rather than a different HEAD request. HTTP/1.1 is selected explicitly for this diagnostic baseline. The normal browser’s behaviour with another protocol needs separate observation.

This command does not follow redirects. If you receive 301 or 302, identify the correct final destination and measure it separately. Do not present redirect timing as the application’s response time. If curl fails, printing some numbers does not turn the failed connection into a valid sample.

Cumulative times, not independent stopwatches

The fields record milestones measured from the start of the operation. Do not add connect to dns to calculate elapsed time up to connection establishment: the former already includes the earlier stage.

FieldMilestone
dnsName resolution completed.
connectThe TCP connection to the destination or proxy completed.
tlsThe TLS handshake on the new HTTPS connection completed.
readyPreparation for the transfer completed.
first_byteThe first byte of the response arrived.
totalThe complete operation finished.

For one new, direct HTTPS connection as used in this example, without a proxy or redirects, connect − dns gives an indication of the TCP stage and tls − connect of TLS negotiation. Plain HTTP has no corresponding TLS stage. Do not carry this TCP breakdown unchanged into HTTP/3.

The difference first_byte − ready is particularly useful if it is named accurately. It includes sending the request, the network journey, possible queues and processing before a response arrives. It does not independently prove how many milliseconds PHP required. That conclusion needs correlation with application or server evidence.

A small experiment with two different waits

To test the distinction between initial response and completion, we ran an isolated local experiment. An HTTP server listened only on 127.0.0.1. The first route introduced an artificial 400 ms wait before sending any response headers. The second sent headers immediately, then waited 400 ms before completing the same small body.

We made five separate curl runs for each route. These are the observed medians, rounded to the nearest millisecond:

Local routeFirst byteTotal time
Wait before sending headers409 ms409 ms
Immediate headers, wait before body1 ms406 ms

The second TTFB looks much better, yet response completion remains on roughly the same scale. We are not recommending this as an optimisation to make a score look good. It is a controlled demonstration of the distinction between the two timers.

The experiment has no actual DNS query, TLS, CDN, external network or production workload. It is neither a Stigmahost hosting benchmark nor a customer result. It demonstrates only that moving the wait changes the first byte without a corresponding change in completion time.

From a pattern to the next useful test

For your own site, begin with a few spaced repetitions of the same URL. Record the time, measurement location, status and cache state. The first run can differ from later runs, including because name resolution is now served from cache. A small sample is a diagnostic tool, not proof of every visitor’s experience.

  • If the substantial wait appears during name resolution, compare the same hostname and resolver. Adding PHP workers does not address that observation.
  • If connection establishment or TLS stands out, investigate the network path and specific endpoint. With a corporate proxy, the measurement includes intermediate systems as well as the final server.
  • If the wait remains after connection preparation, correlate the timestamp with logs, cache misses, external calls and queries. Start with the particular URL that is slow.
  • If the first byte arrives quickly but completion is slow, investigate the remaining response. Loading images, CSS and JavaScript needs an additional browser check.

Then change one factor and repeat under the same conditions. Record what would make you reject the original hypothesis, too. Improving a cached homepage alone does not establish that a dynamic function or a visit from another region has improved.

When measurements support an infrastructure decision

For a technical discussion about Stigmahost Web Hosting, a small recorded sample is more useful than saying that the site is slow. It identifies the tested URL, the connection conditions and the stage where waiting accumulates.

If the evidence establishes a need for different resources or more control over the environment, assess the VPS options alongside the application’s requirements. A VPS does not automatically reduce DNS time, distance from users or a slow external service. A useful decision follows the evidence: locate the stage, state a testable hypothesis and verify that the intervention changed what you were actually measuring.

Share this Post