How to Reduce WordPress TTFB: Fixes in the Order That Matters

Reduce WordPress TTFB by measuring cached and uncached separately, then fixing in order: page cache, PHP, object cache, slow plugins, and the host.

Dobromir Dechev
Dobromir WordPress agency owner

Quick answer

Measure TTFB twice: once for a cached page and once for an uncached one. A slow cached TTFB is a caching or CDN problem. A slow uncached TTFB is PHP, the database, plugins, or the host. Fix them in that order: page cache, PHP version and OPcache, object cache, plugin audit, then the host.

TTFB, time to first byte, is how long the browser waits before any of your page arrives. Nothing renders during that time, so whatever your TTFB is gets added directly to your Largest Contentful Paint.

Most TTFB advice lists twenty tips in no particular order. That doesn't help, because TTFB is really two separate numbers with different causes. If you fix the wrong one, an afternoon of work shows no improvement.

This guide measures both, then works through the fixes in the order that gives the most return for the effort.


Step 1: Measure the two TTFBs separately

Every WordPress site has a cached TTFB (a page served from a full-page cache) and an uncached TTFB (WordPress actually running PHP and querying the database). They differ by roughly 5–20×, and they're fixed in different places.

Measure the uncached one with a cache-busting query string:

curl -o /dev/null -s -w 'TTFB: %{time_starttransfer}s\n' "https://yoursite.com/?nocache=$RANDOM"

Measure the cached one by requesting the same page twice and reading the second result:

curl -o /dev/null -s https://yoursite.com/
curl -o /dev/null -s -w 'TTFB: %{time_starttransfer}s\n' https://yoursite.com/

Then confirm the second request really was a cache hit:

curl -sI https://yoursite.com/ | grep -iE 'cache|age|x-litespeed|cf-cache'

You're looking for something like x-cache: HIT, x-litespeed-cache: hit, cf-cache-status: HIT, or an age header greater than zero.

Run each measurement five times and take the middle value. Single measurements vary too much to act on.

What the numbers should look like

For reference, here's what our hosting speed test recorded on a bare WordPress install, measured from Sofia:

HostUncached TTFBCached TTFB
Hetzner CX32 + CloudPanel155ms35ms
Cloudways Vultr HF198ms32ms
Rocket.net214ms14ms
Kinsta218ms28ms
WP Engine261ms41ms
SiteGround Go Geek382ms87ms
Hostinger Business428ms148ms

Those are floors with no plugins installed. A real site with a theme, a page builder and twenty plugins will be slower uncached. Cached TTFB should stay close to these figures, because a cached page skips the plugins entirely.

Read your results like this:

  • Cached TTFB slow (over ~150ms from nearby): caching or network problem. Go to Steps 2–3.
  • Cached fast, uncached slow (over ~500ms): PHP, database, or plugin problem. Go to Steps 4–6.
  • Uncached still slow on a bare install: hosting problem. Go to Step 7.

Step 2: Make sure the page cache actually hits

One of the most common TTFB problems is a page cache that's installed but isn't serving anything. The usual causes:

  • A cookie that bypasses the cache. Many caching setups skip any request that carries certain cookies. A plugin that sets a cookie for every visitor (some consent banners, A/B testing tools, currency switchers) quietly turns off caching for everyone.
  • Query strings. Links with ?utm_source= or ?fbclid= are treated as unique URLs and miss the cache unless they're configured as ignored parameters. WP Rocket and LiteSpeed Cache both have settings for this.
  • Two caching layers fighting. A host cache and a plugin cache both trying to manage the same pages. Look in wp-content/advanced-cache.php to see which plugin owns the cache.
  • Cache was never enabled. It sounds obvious, but it's surprisingly common after a migration.

If you're on a LiteSpeed server, LiteSpeed Cache gives you server-level caching for free. On anything else, a well-configured PHP-level cache is the right tool. Our WP Rocket vs LiteSpeed Cache comparison explains which one fits your server.

Turn on cache preloading. After every purge, the first visitor to each page gets the uncached TTFB. Preloading crawls your sitemap and warms the cache before anyone arrives.


Step 3: Cache HTML near your visitors

Network distance adds latency before your server does anything. A visitor in Sydney requesting a page from a Frankfurt server waits for a round trip of 250ms or more, however fast the server is.

A standard CDN won't fix this. Most CDN setups cache images and scripts but still fetch the HTML from your server every time, so TTFB stays the same.

What does fix it is caching the HTML at the edge:

  • Cloudflare APO (paid add-on on Cloudflare's free plan, included on paid plans) caches WordPress HTML across Cloudflare's network and handles purging. Our Cloudflare setup guide covers the setup.
  • Cloudflare cache rules can do the same for free if you configure the bypass rules for logged-in users and WooCommerce cookies yourself.
  • A host with edge caching built in. That's why Rocket.net's cached TTFB in our test was 14ms: the page came from a Cloudflare edge location near the tester, not from the origin server.

If your audience is in one country and your server is in or near it, skip this step. Distance isn't your problem.


Step 4: Upgrade PHP and check OPcache

These next steps affect uncached requests: cart, checkout, account pages, logged-in editors, search results, and the first visit after every purge.

PHP version. Run a supported PHP 8.x release. 8.3 or newer is the safe choice in late 2026. Each 8.x version has been a little faster than the one before. PHP 7.4 is years past end of life, and it's still more common on client sites than it should be. Check under Tools → Site Health → Info → Server.

Test the upgrade on a staging site first. Old plugins that use removed functions will show fatal errors.

OPcache. OPcache keeps compiled PHP in memory so WordPress isn't recompiled on every request. Nearly every host enables it, but not all. Site Health shows whether it's on. If it isn't, ask your host. This is a server setting, and you can't add it with a plugin.


Step 5: Add a persistent object cache

By default, WordPress forgets every database query result at the end of each request. A persistent object cache keeps those results in Redis or Memcached, so the next request reads them from memory instead of querying the database again.

On a simple blog with a page cache, this barely matters. On WooCommerce, membership sites, and anything with logged-in users, it's often the single biggest improvement to uncached TTFB, because those pages can't be page-cached at all.

What you need:

  1. Redis available on the server (most managed hosts and CloudPanel include it, and Cloudways offers it as an add-on).
  2. A connector plugin: Redis Object Cache is the standard free choice. LiteSpeed Cache has one built in.
  3. A check that it's working: the plugin's status screen should say "Connected", and Query Monitor should show a high cache hit rate.

Step 6: Find the slow plugin

If PHP is current, the object cache is on, and uncached TTFB is still high, something is doing too much work on each request. Usually that's a plugin.

Install Query Monitor, log in, and load a slow uncached page. Check:

  • Page generation time in the admin bar. That's the server-side part of your TTFB.
  • Queries → Slow queries. Anything over 0.05s is worth investigating.
  • Queries by Component. This shows which plugin runs the most queries, which is usually the answer.
  • HTTP API calls. A plugin making an external request during page load (a licence check, a remote font, a social count) can add hundreds of milliseconds by itself.

Our plugin performance audit covers the full process, including how to test plugins on staging without breaking anything.

The usual suspects: related-posts plugins that run heavy queries on every page view, statistics plugins that write to the database on each request, and page builders that load on pages where they aren't used.


Step 7: When the host is the problem

Run the bare-install test: a fresh WordPress install on your current plan, default theme, no plugins, measured uncached. If that's above about 300ms from a location near the server, no amount of optimisation will bring your real site under it. That number is the floor.

Shared hosting usually hits this limit first, because CPU and disk are shared with other accounts. In our speed test, the gap between the fastest and slowest uncached host was more than 5×, all running the same WordPress install.

The fix is a better host:

  • Cloudways if you want cloud server performance with a managed panel. It came second for uncached TTFB in our test at 198ms.
  • Kinsta if you want fully managed hosting with consistent response times. Its slowest of ten uncached measurements was only 30ms above the median.
  • Rocket.net if your audience is spread out and edge caching matters most.

If you're moving from SiteGround specifically, our SiteGround to Cloudways migration guide covers the steps without downtime.


Checklist

  1. Measure cached and uncached TTFB separately, five runs each, middle value.
  2. Confirm the cache is actually hitting (check the headers).
  3. Fix cache bypasses: cookies, query strings, conflicting caches. Turn on preloading.
  4. Add HTML edge caching if your visitors are far from the server.
  5. PHP 8.3+, OPcache on.
  6. Redis object cache, especially for WooCommerce and logged-in users.
  7. Query Monitor on a slow uncached page to find the plugin responsible.
  8. Bare-install test. If the floor is too high, move hosts.

Frequently Asked Questions

What is a good TTFB for WordPress?
For cached pages, under 100ms from a nearby location, and well-configured stacks reach 15–40ms. For uncached pages (cart, checkout, logged-in users, the first visit after a purge), under 300ms is good and under 200ms is excellent. Google's guidance treats a TTFB under 800ms as a reasonable upper limit, but that's a floor, not a target.
Why is my TTFB slow even with a caching plugin?
Usually one of three reasons. The page isn't actually being cached, because a cookie or query string bypasses it. You're measuring an uncached page, such as a logged-in view or checkout. Or the visitor is far from the server, so network distance adds latency before any byte arrives. Check the cache status header first.
Does a CDN reduce TTFB?
Only if it caches the HTML. Most CDN setups cache images, CSS and JavaScript but still fetch every HTML page from your server, so TTFB doesn't change. HTML edge caching, such as Cloudflare APO or a host's edge cache, is what moves TTFB for distant visitors.
Does PHP version affect TTFB?
Yes, on uncached requests. Each PHP 8.x release has been somewhat faster than the last, and PHP 7.x is no longer supported. Upgrading is usually free and takes a few minutes, but test on staging first because older plugins can break.
How do I measure TTFB without tools?
Run curl -o /dev/null -s -w '%{time_starttransfer}\n' https://yoursite.com in a terminal. The number is seconds to first byte. Add ?nocache=123 to the URL to measure an uncached response on most setups.

Was this article helpful?