TTFB Request Duration: Reduce Server Processing Time
The server's part of TTFB: what DevTools and web-vitals call it, how Server-Timing shows the slow step and why a page cache comes first.
- Good ≤ 0.8 s
- Needs improvement ≤ 1.8 s
- Poor > 1.8 s
Request duration in short
Request duration is the last of the five parts of Time to First Byte (TTFB): from sending the request for the HTML until its first byte arrives. It is the server building the page plus one round trip over the network. On most sites it is the largest part of TTFB: reduce it first, starting with a page cache.
What is request duration, and is it "Waiting (TTFB)" in DevTools?
Request duration is what Chrome DevTools shows in the Network panel's Timing tab as "Waiting for server response", in older versions "Waiting (TTFB)": one round trip of latency plus the time the server took to prepare the response. The web-vitals library reports the same part as requestDuration, CoreDash as Request in its Phase breakdown, and Lighthouse as server response time.
It starts when the connection to the server is ready and ends when the first byte of the HTML reaches the browser. Before it come the other four parts of the Time to First Byte: waiting, cache, DNS and connection. That waiting part is mostly redirects, before the request; it is not DevTools' "Waiting".
The request was the largest part of TTFB at the 75th percentile on 82 of the 86 CoreDash sites with at least 1,000 phone page loads in the 28 days up to 9 November 2026.
What is the server doing while the browser waits?
The request travels to the server and the first byte travels back; in between, the server builds the page:
- Routing: the web server, such as nginx or Apache, hands the request to the application.
- Start-up: the application loads its code; WordPress loads its core, every active plugin and the theme for each page it builds.
- Data: the application queries its database and calls other services, such as a stock or price API.
- HTML: the template turns that data into the page.

One first visit to a WordPress page that wasn't cached, measured in Chrome. Of the 875 ms TTFB, the request took 657 ms.
In that load the connection took 20 ms for two round trips (TCP and TLS), so one round trip was about 10 ms. About 645 of the 657 ms was the server building the page. Close to the server, request duration is nearly all server time; a visitor far away waits for the round trip on top.
Nothing can paint before the first byte of the HTML arrives, so request duration adds to the Largest Contentful Paint too.
Which step on the server is slow? Server-Timing shows it
A Server-Timing header sends the server's own timings along with the HTML, one entry per step: the database, the template, an outside API, a cache hit or miss. Chrome DevTools shows the entries in the Timing tab of the HTML request, under "Waiting for server response", and a real-user monitoring (RUM) tool collects them from your visitors.
Server-Timing: db;dur=53.2;desc="Database", tpl;dur=18.7;desc="Template", cache;desc="MISS"

One load on a local WordPress test install, slower with DevTools open: the two Server-Timing entries, 27.8 and 27.1 ms, fit inside the 59 ms the browser waited for the server.
Anyone who opens DevTools can read the header. Send step names and durations only, never a query, a file path or an internal host name, or send the header only to logged-in staff (MDN).
Server-Timing in PHP
Time each step with hrtime(true) and send the header before the page:
$t = hrtime(true);
$products = $pdo->query('SELECT * FROM products WHERE active = 1')->fetchAll();
$db = (hrtime(true) - $t) / 1e6;
$t = hrtime(true);
$html = renderTemplate('product-list', ['products' => $products]);
$tpl = (hrtime(true) - $t) / 1e6;
header(sprintf('Server-Timing: db;dur=%.1f;desc="Database", tpl;dur=%.1f;desc="Template"', $db, $tpl));
echo $html;
PHP sends its headers with the first output that leaves the server. A header() call after that is dropped with a "headers already sent" warning, so a template that prints as it goes needs output buffering.
Server-Timing in Node.js and Express
In Express, set the header before res.send():
app.get('/products', async (req, res) => {
const t0 = performance.now();
const products = await db.query('SELECT * FROM products WHERE active = 1');
const t1 = performance.now();
const html = renderTemplate('product-list', { products });
const t2 = performance.now();
res.set('Server-Timing',
`db;dur=${(t1 - t0).toFixed(1)};desc="Database", tpl;dur=${(t2 - t1).toFixed(1)};desc="Template"`);
res.send(html);
});
Node sends the headers with the first res.write(). In a route that streams, set Server-Timing before the first write: later, Node throws ERR_HTTP_HEADERS_SENT.
How do you measure request duration?
Request duration for your visitors comes from real-user monitoring (RUM): CoreDash shows Request in the Phase breakdown of its TTFB page, per page, and the web-vitals library reports requestDuration in its TTFB attribution.
Google has no threshold for request duration; Lighthouse's Document request latency notice flags a server response over 600 ms. Across all phone page loads on the 133 CoreDash sites with phone data in the 28 days up to 9 November 2026, the request part was 404 ms at the 75th percentile.
In your own code, the web-vitals library also gives the Server-Timing entries the page arrived with:
import { onTTFB } from 'web-vitals/attribution';
onTTFB(({ value, attribution }) => {
console.log('TTFB', Math.round(value), 'ms');
console.log('Request duration', Math.round(attribution.requestDuration), 'ms');
const nav = attribution.navigationEntry;
if (nav) {
if (nav.finalResponseHeadersStart) { // Chrome 133 and later
console.log('Final response headers at', Math.round(nav.finalResponseHeadersStart), 'ms');
}
console.table((nav.serverTiming || []).map(({ name, duration }) => ({ name, duration })));
}
});
Both numbers come from the Navigation Timing API: TTFB is the navigation entry's responseStart, and web-vitals computes requestDuration as TTFB minus connectEnd. The entry's serverTiming list holds the header's entries as PerformanceServerTiming objects, the Server-Timing API in the browser, so a RUM script can send them with each page view.

CoreDash, TTFB on phones split into its five parts on acme-pagespeed.com: look for the longest bar, here Request.
103 Early Hints make the request duration look short. Chrome counts a 103 as the first byte, so TTFB and request duration end when the hint arrives, while the server is still building the page. Shopify sends them, and so does Cloudflare with Early Hints on. The navigation entry's finalResponseHeadersStart or a Server-Timing entry shows the real server time; 103 Early Hints has the setup.
An APM, or OpenTelemetry's http.server.request.duration, measures inside the application, without the network and any queue in front of it, so RUM shows a higher request duration. One load in DevTools ("Waiting for server response") is one cache hit or miss from your own computer; field data holds every miss and every visitor far away. How to check and fix a slow TTFB shows how to find the pages and visitors with a slow request part.
Why is the server slow to send the first byte?
On most sites a slow TTFB means the server builds the page again for every visitor: there is no page cache, or the visitor skips it. Pages that can't be cached are slow because of the work they do: a slow query, an outside API the page waits for, too little CPU.
| What you see | Usual cause | Where to look |
|---|---|---|
| Slow on every page, logged out | No page cache, or it misses | The cache header: HIT or MISS |
| Slow logged in or with a cart | The page can't be cached | Server-Timing |
| Slow on links from ads and mail | A query string not in the cache | The URL with and without ?gclid= |
| Slow on search and account pages | A slow query or an outside call | Server-Timing, Query Monitor |
| Fast nearby, slow far away | The round trip to your server | RUM by country |
| Slower from one day on | A release, or a broken cache | The request part's trend in RUM |
| Slow after a quiet hour | An expired cache or a cold start | The first load against the second |
How do you reduce request duration?
Start with a page cache. A stored copy of the page skips the server's work, and on most sites that work is the largest part of a slow time to first byte (TTFB). Pages that can't be cached need the server itself to get faster.
WordPress and WooCommerce
Switch on the page cache in WP Rocket, LiteSpeed Cache or at your host. My plugin, WP Core Web Vitals, sends the cached page before WordPress and the other plugins load, about five times faster than serving the same page from inside WordPress.
Check the result logged out, in a private window: logged-in users, a cart cookie and a query string the cache doesn't know skip the cache.
On a local WordPress test install with a default theme, the page cache took the request part of the home page from 31 ms to about 1 ms, the median of 15 loads each. A real site takes longer to build a page; its cached copy comes back about as fast.

A local install has no network, so both bars are the server's work.
A membership site where everyone is logged in, or a shop where most visitors have a cart, gets little out of a page cache: every request there is PHP and database work. An object cache such as Redis keeps repeated database results in memory; at many hosts it is a switch or a request to support. Query Monitor lists the slow database queries and the plugin they come from.
Shopify
The server, its cache and the CDN are Shopify's. Yours is the Liquid of the theme and its app blocks, which Shopify renders on its servers. Shopify Theme Inspector for Chrome shows which section or snippet takes long: trim it, or replace the app that adds it.
A page cache in front of your application
A reverse proxy, the CDN or a cache that answers before your framework starts skips the application's work. This header lets a CDN or proxy keep the HTML for ten minutes and serve it one more minute while it fetches a fresh copy, and makes the browser ask again on every visit:
Cache-Control: public, max-age=0, s-maxage=600, stale-while-revalidate=60
I didn't make my WordPress plugin serve the cached file straight from nginx or Apache: that would hardly be faster, and every check on cookies and URL parameters would have to be copied into the server configuration.
A Set-Cookie on every response, for a session or an A/B test, often keeps the page out of a CDN's cache. Vary: Cookie asks for a copy per cookie value, which with analytics cookies means almost no hits. Each new gclid or utm_source value from an ad is a new URL, unless the cache ignores those parameters. To time the server without the cache, load the page with a parameter your caches don't ignore, such as ?test= with a new value each time, and check that every cache header says MISS.
A CDN that keeps the HTML
A CDN that caches the HTML answers from a server near the visitor, so the time to first byte no longer includes the trip to your server or its work. A CDN that caches only images and scripts passes every HTML request on to your server. On Cloudflare, HTML is cached only with a Cache Rule, or APO for WordPress: Configure Cloudflare for the Core Web Vitals has the settings. Code at the CDN's edge that needs your database still waits for the round trip to it.
Pages built for each visitor
Logged-in pages, the cart and search results can't come from a page cache; Server-Timing names the slow step. For the database: an index for the slow query, and one query for a list instead of one per item (the N+1 pattern). A page that waits for a database or an API in another data centre adds that round trip to every request: cache its answer, and call services that don't depend on each other at the same time.
const [stock, prices] = await Promise.all([getStock(id), getPrices(id)]);
Sending mail, writing logs and syncing stock can wait: do them after the response or in a queue.
The server and the host
A new host makes sense when Server-Timing and your RUM data show that the server itself is slow: the cached pages are fast, and on the uncached ones every step takes long. Many hosting upgrades only add storage; a faster server needs more CPU and memory. Run a current PHP version with OPcache on. A serverless function waits for a cold start after a quiet period: keep an instance warm, or put a page cache in front.
TTFB in JavaScript frameworks (Next.js, Nuxt, SvelteKit)
A JavaScript framework that renders every page on the server per request gives the TTFB of an uncached page. In practice that comes with the CMS content fetched live for each page and Cache-Control: private or no-store, so the CDN can't keep the HTML either. Render pages static or cached wherever the content allows (in Next.js, use cache), cache the CMS fetches and let the CDN keep the HTML. Stream what stays dynamic behind <Suspense>, so the head with the stylesheets goes out first. Cookies or headers read in a layout make every page below it render per request.
Did the server get faster for real visitors?
Check one load first, logged out in a private window, then with ?gclid= and a new value. The response headers should show a cache hit (cf-cache-status: HIT on Cloudflare, X-CWV-Cache: HIT with WP Core Web Vitals) and your Server-Timing entries; a MISS on the ?gclid= load means visitors from ads wait for the server. A release needs the HTML cleared at the CDN as well, or visitors keep getting the old page.
The next day, the Request part in your RUM data shows the change. PageSpeed Insights shows only the whole TTFB over the last 28 days, so it moves slowly.
Some slow requests need more than a cache or a setting: a shop where every visitor has a cart, or a host or a backend you can't change. In one Core Web Vitals power hour we read your Server-Timing entries and slowest pages, and settle what the server stops doing first and who does it: your host or your developer.

Need a faster site?
I'm Arjen, and I've been fixing slow sites for 17 years. If you're running into issues you can't fix yourself, send me your URL and let's have a chat.
Send me your URL
Why isn't our fix working?
Sometimes the CDN still serves the old HTML, or the fix went into the desktop template and mobile uses another one. Send me your URL and the problem, and I reply with a few times. I check your field data first, then we spend one hour on your site, and within a day you have my notes in writing. €350 excl. VAT.
Send me your URLNo developer to build the fix? I do the work myself, on a copy of your site.