How to Reduce TTFB in WordPress: 0.87 s to 0.15 s in My Test
I took one of my guides from a 0.872 s time to first byte down to 0.145 s, on a test copy of the page, measured with curl from Dhaka. Below is how to reduce TTFB in WordPress the same way: the two changes that moved the number, and the common fixes that cannot.
The test is the one from my FlyingPress vs WP Rocket comparison: same page, same VPS, first with no cache plugin, then with a tuned page cache, then with Cloudflare’s edge cache on top. Many TTFB guides give a list of tips and no before-and-after test on one page. I have the numbers, and I list what I did not measure near the end.
Everything here comes from my own setup: a VPS running Nginx with aaPanel, a Redis object cache, and Cloudflare on the free plan. If you are on shared hosting, there is a section on what you can still change.
The short version
- Turning on FlyingPress with my final settings (its page cache is the part that matters for TTFB) took it from 0.872 s down to 0.385 s.
- Cloudflare’s edge cache took it from 0.385 s to 0.145 s. It should help visitors far from your server; I only tested from Dhaka.
- PHP version, Redis, the database and plugin audits matter when a request skips the cache (logged-in users, the first visit after a purge). I give no number for them.
- Image compression, minifying and lazy loading do not change TTFB.
Table of Contents
My result: 0.872 s to 0.145 s
| Step | What was on | TTFB (median) | Change vs step 1 |
|---|---|---|---|
| 1 | No cache plugin | 0.872 s (0.874 s at the end of testing) | baseline |
| 2 | FlyingPress, fully tuned (page cache on) | 0.385 s | 56% lower |
| 3 | FlyingPress plus Cloudflare edge page cache | 0.145 s | 83% lower |
Method: curl, six requests per run, first request dropped, median reported. The page was a copy of a WebPickr guide on a noindexed test domain, on my own VPS running Nginx, tested from Dhaka on 28 October 2026 between 12:30 and 4:30 pm. The no-cache run was repeated at the end and came back at 0.874 s, so the baseline did not drift during the test. Redis was most likely already on in every run, so the drop comes from FlyingPress, not from Redis. The full write-up is in the comparison post.
The live check from 6 November (0.177 s, shown in the curl section below) is a different page on a different day, so I only compare it loosely: both are edge hits and both are under 0.2 s.
Step 3 is a different kind of number from step 2. A Cloudflare hit means the request never reached WordPress or my VPS, so you are measuring the distance to the nearest Cloudflare location. Step 2 is my server answering from its page cache. Both are TTFB, but they answer different questions, so when you tune, test both.
To see the slow path, add a query string such as ?nocache=1 to the URL. In my header check, Cloudflare bypassed its cache and FlyingPress reported a miss, which means WordPress had to build the page. I did not time that request. The stale cache guide shows how to read those headers.
What TTFB is, and what counts as good
TTFB is the time from the moment the browser starts loading a page until the first byte of the response arrives. According to web.dev’s TTFB guide, it adds up redirects, the DNS lookup, connection and TLS setup, and the wait for the server to answer. Nothing on the page can start rendering before that first byte lands, so a slow TTFB drags First Contentful Paint and Largest Contentful Paint with it. TTFB is only one of the four parts of LCP; my Largest Contentful Paint guide covers the other three.
web.dev gives a rough guide: 0.8 s or less is good, between 0.8 s and 1.8 s needs improvement, and more than 1.8 s is poor. The Lighthouse “server response time” audit is stricter. It fails above 600 ms, and it only counts the wait after the request is sent, not the DNS lookup or redirects, so it reads lower than a full TTFB. In Lighthouse 13 it moved into the “Document request latency” insight.
TTFB is not a Core Web Vital, and web.dev says so. It is worth chasing when it stops you from getting good FCP and LCP numbers. Some guides say to aim for under 200 ms. Google’s own lines are 0.8 s on web.dev and 600 ms in Lighthouse, so treat 200 ms as a goal for a cached page, not a rule.
How to measure TTFB (and why two tools disagree)
Pick one method and stick with it, because the tools count different things. Always test a logged-out page or a private window. Logged-in requests skip the page cache, so they show the slow path, not what visitors get.
| Tool | What it measures | Use it for |
|---|---|---|
curl (time_starttransfer) | The whole TTFB from your machine: DNS, connection, TLS and the wait | Repeatable numbers to compare before and after a change |
| Chrome DevTools, Timing tab | Separate rows for DNS, connection, SSL and “Waiting for server response” | Seeing which part of the wait is slow |
| PageSpeed Insights | A lab test from a Google data center, plus real-user data when the page has enough traffic | A second opinion and field data |
| WebPageTest, KeyCDN performance test, GTmetrix | The same page loaded from other cities | Checking visitors far from your server |
curl: the number I trust for before and after
This is the command I use on Windows (Command Prompt, Windows 10 and later). It downloads the page, throws the content away, and prints the TTFB and the total time. It only reads the page and changes nothing on your site. On Mac or Linux, replace NUL with /dev/null.
curl -o NUL -s -w "TTFB %{time_starttransfer}s total %{time_total}s\n" https://example.com/your-page/
Run it five or six times. Drop the first run, which often pays for a cold connection or a cold cache, and take the median of the rest. My five live runs below spread over 0.025 s, so I do not read much into differences smaller than about 0.05 s.

On 6 November I only ran it five times, on a live WebPickr post: 0.355 s (dropped), then 0.176, 0.178, 0.170 and 0.195 s. The median of those four is 0.177 s, and the page was a Cloudflare edge hit.
Chrome DevTools: which part of the wait is slow
Open DevTools with F12, go to Network, reload, click the first row (the page itself) and open the Timing tab. Chrome lists DNS lookup, initial connection and SSL as their own rows. “Waiting for server response” is the last piece of TTFB, after the connection is ready.

The same page, the same day: 15.30 ms waiting for the server, against 177 ms from curl. Both are right. curl counts everything up to the first byte, including DNS and the TLS handshake. DevTools shows only the final wait, and on a reload the browser can reuse an open connection, so the rows above it can be small or empty. I did not time DNS and TLS separately, so the gap is most likely that setup, not a measured split. To see the split yourself, add dns %{time_namelookup} connect %{time_connect} tls %{time_appconnect} inside the quotes after -w; it only prints extra timings. When people quote two different TTFB numbers for one page, check which of these they measured.
PageSpeed Insights: a second opinion
PageSpeed Insights runs Lighthouse from a Google data center, so it shows what a visitor far from you might see. It also shows real-user data for pages with enough traffic. My page does not have that yet, so these are lab numbers only.

Mobile result on 6 November (Lighthouse 13.6.0): performance 100, FCP 1.1 s, LCP 1.2 s, TBT 0 ms, CLS 0, Speed Index 1.1 s. With a cached page, the server is not what holds the score back. Lighthouse 13 reports the server wait under “Document request latency”.
From other cities
Edge TTFB depends on how close the nearest Cloudflare location is to the visitor. If your readers are elsewhere, run the free tools from the last row of the table in their cities and compare.
You can also run our free TTFB checker, which shows cached and uncached TTFB side by side from the Cloudflare data center nearest to you.
How to reduce TTFB in WordPress, in the order I would do it
1. A page cache
A page cache saves the finished HTML of a page and serves that file instead of running PHP and the database for every visit. The page cache is the part of FlyingPress that matters for TTFB. The 0.487 s came off with all my final settings on, so I cannot split it further. I use FlyingPress; my FlyingPress review covers what it does, and my FlyingPress settings guide has the setup I run. If you are still picking a cache plugin, my best WordPress cache plugins guide compares the TTFB of ten of them on one server.
One caveat: my Cloudflare rule skips visitors with a WordPress login cookie, so when I am logged in I never see these numbers. If you run WooCommerce, also exclude cart, checkout and account pages from the cache, and use cache preload if your plugin has it, so the first visit after a purge is not the slow one. Which purge buttons also preload is in my guide on how to clear WordPress cache.
Most of the page caches I measured on my separate test site ended up close together, so turning one on matters more than which one; WP Rocket vs W3 Total Cache and my xSpeed Cache review have those numbers.
2. An edge cache
By default Cloudflare caches static files such as images, CSS and JavaScript, but not HTML pages. FlyingPress’s Cloudflare integration adds two rules to your account: one for pages (for logged-out visitors) and one for static files. I use that integration and not Cloudflare’s paid APO, which I have not tested. The steps are in my Cloudflare settings for WordPress guide.
Each Cloudflare location fills its own cache, so the first request there is a miss and the next ones are hits. If a hit never shows up, read the headers before you change anything else.
To confirm which layer answered, my guide on checking if WordPress cache is working lists the headers to look for, and cf-cache-status explained covers each Cloudflare value.
3. The server underneath
My origin is my own VPS with aaPanel and Nginx; the provider is covered in the YottaSrc review. My VPS is in Hong Kong and the curl runs came from Dhaka, so distance is part of these numbers. With both caches on, the server matters less for most visits, but it still decides the slow path: the first visit after a purge, logged-in users and pages that cannot be cached. The trade-offs are in shared hosting vs VPS.
4. A supported PHP version, with OPcache on
Prefer PHP 8.3 or newer. As of 5 November 2026, php.net lists 8.4 and 8.5 under active support (the 8.4 branch ends on 31 December 2026), and 8.2 and 8.3 under security fixes only. Security support for 8.2 ends on 31 December 2026. Switch on a staging copy or after a backup, then check the site and measure again. Keep WordPress core, plugins and theme updated too, and be wary of heavy themes and page builders on the uncached path.
OPcache keeps compiled PHP code in memory so PHP does not recompile it on every request. It ships with PHP, so check that it is switched on (phpinfo or your host panel). I will not promise a percentage for either change. Measure yours with the curl command.
5. An object cache (Redis)
An object cache keeps the results of repeated database queries in memory while WordPress builds a page. It helps on requests that skip the page cache. On 6 November the FlyingPress Redis panel showed 32.2 MB used out of 2 GB and a 99% hit rate on my Redis instance.

A high hit rate means WordPress mostly gets query results from memory. My Redis object cache guide covers the setup on aaPanel.
6. The database: one number worth checking
Since WordPress 6.6, Site Health raises a critical warning when the autoloaded options in your database pass 800 KB, because WordPress loads those on every request. Open Tools, then Site Health, then Status. If the warning is not there, leave the database alone. If it is, find which plugin owns the large option; it is often leftover data from a plugin you deleted.
7. Plugins and theme on the slow path
The free Query Monitor plugin lists slow database queries and shows which plugin or theme ran them. It also lists slow external HTTP calls. Use it on requests that skip the cache, and deactivate suspects on a staging copy first. A heavy wp-cron can add load too; some hosts let you swap it for a real server cron.
8. Redirects
Redirects count toward TTFB. A chain like http to https to www to the final address adds a connection each time. Test the final address directly. To see the chain, run curl -I -L https://yourdomain.com: -I fetches only the headers and -L follows redirects. It reads and changes nothing.
What does not lower TTFB
Compressing images, minifying or combining CSS and JavaScript, lazy loading and delaying scripts all change what happens after the first byte. They help LCP and Total Blocking Time. They do not move TTFB, so do not use them to fix a slow server response. I do use them, for the other metrics.
Those changes still matter for LCP, and removing unused CSS is the one that cut LCP the most in my WP Rocket test.
If you are on shared hosting
You can still turn on a page cache plugin, put Cloudflare in front, pick a supported PHP version in your host’s panel and check the autoload warning. You usually cannot tune Nginx, add your own Redis server or choose better hardware. If caching does not fix a slow first byte on shared hosting, the server is the limit and the answer is a move, as in the shared hosting vs VPS post.
A checklist you can follow in order
- Measure first: six curl runs on a logged-out URL, drop the first, note the median.
- Turn on a page cache and measure again. Confirm the page comes back as a cache hit in the headers.
- Add an edge cache and measure twice: the first request may be a miss, the second should be a hit.
- Check that you run a supported PHP version with OPcache on.
- Add Redis if your server supports it and you have pages that skip the page cache.
- Open Site Health and look at the autoloaded options warning.
- Use Query Monitor on an uncached request to find slow plugins.
- Measure again from the cities your readers live in.
This is an affiliate link: I may earn a commission at no extra cost to you. If you want the page cache I use, here is FlyingPress.
When TTFB is not your problem
If your cached TTFB is well under 0.8 s and LCP is good, stop. My page scores 100 on mobile in PageSpeed Insights with an LCP of 1.2 s, and more TTFB work would not change what visitors feel. If the first run is slow and the next ones are fast, that is a cold cache, not a slow server.
What I did not measure
- The uncached request (the
?nocache=1slow path). - Redis switched off, to see what it saves.
- Differences between PHP versions.
- A shared hosting plan.
- Other cities, and Cloudflare APO.
FAQ
What is a good TTFB for WordPress?
Google’s rough guide is 0.8 s or less. On my site a Cloudflare hit measured about 0.145 s to 0.177 s from Dhaka, and my server answering from its page cache measured 0.385 s. Compare your own before and after numbers with the same tool.
Is TTFB a ranking factor?
Google does not count TTFB as a Core Web Vital, and I have no data showing it affects rankings on its own. A slow first byte can still delay FCP and LCP, and LCP is a Core Web Vital.
What if PageSpeed Insights reports a slower first byte than my own test?
PageSpeed Insights tests from a Google data center, so it may reach a Cloudflare location whose cache is still empty. Run it twice. If the second run is faster, the first was a cache miss.
Why is TTFB 15 ms in DevTools but 177 ms in curl?
curl counts everything up to the first byte, including DNS and TLS setup. The DevTools row “Waiting for server response” is only the last part, after the connection is ready.
Does a CDN reduce TTFB?
Mostly when it caches your HTML. By default Cloudflare caches static files, not pages. With page caching rules in place, my TTFB went from 0.385 s to 0.145 s.
Does Redis reduce TTFB?
It saves repeated database queries when WordPress builds a page, so it helps requests that skip the page cache. I have no with-and-without number for it.
How do I improve TTFB on shared hosting?
Turn on a page cache, put Cloudflare in front, pick a supported PHP version and check the autoload warning. If the first byte is still slow after that, the server is the limit.
Why is my TTFB slow only sometimes?
Usually a cache miss: the first visit after you publish, update or purge. The page is built once and cached for the next visitors. The stale cache guide shows how to check the headers.
Next: if you update a page and still see the old version, read WordPress changes not showing: find the stale cache in 2 minutes.
