How to reduce Time to First Byte (TTFB)

How to reduce Time to First Byte on WordPress and other sites: hosting, page caching, PHP, database, plugins, CDN edge caching and DNS.

Usman Muhammad UsmanUpdated October 13, 2026
How to reduce Time to First Byte (TTFB)

Time to First Byte (TTFB) is how long the browser waits before receiving the first byte of a page from the server. Everything else, including Largest Contentful Paint, has to wait for it. A slow TTFB usually points to server-side problems: hosting, caching, PHP or the database. This guide explains how to diagnose and fix it.

What TTFB includes

TTFB covers several steps: DNS lookup, connecting to the server, the TLS handshake for HTTPS, the server generating the page and the first data travelling back. A slow result can come from any of these, so it helps to know which part is slow.

Google suggests aiming for a TTFB of about 0.8 seconds or less as a rough guide for good performance, though it is not a Core Web Vital itself. Because LCP cannot happen before TTFB, a slow server response makes passing LCP much harder.

Measure it properly

PageSpeed Insights shows TTFB from real users in the field data section. WebPageTest breaks down DNS, connection, TLS and server time for a single test. Chrome DevTools’ Network tab shows waiting time for the main document.

Test from locations near your visitors and far away. A good TTFB near the server but poor far away points to network latency, which a CDN can help. A poor TTFB everywhere points to slow page generation on the server.

Reducing TTFB
  1. 1MeasureNear and far
  2. 2Page cachingBiggest win
  3. 3Hosting and PHPModern server
  4. 4DatabaseQueries, autoload, Redis
  5. 5Edge cachingCDN for global visitors

Enable page caching

On WordPress, uncached pages require PHP to run, plugins to load and the database to be queried. Page caching serves ready-made HTML, often reducing TTFB from over a second to a fraction of that. This is the most important fix for most sites.

Check that caching is actually working: response headers often show whether a page was served from cache. If the cache rarely hits, look for settings, cookies or query strings that bypass it. See WordPress caching explained.

Improve hosting

Overloaded shared servers, old hardware and distant data centres all increase TTFB. If uncached pages are consistently slow and caching cannot be used for many pages, such as for stores, better hosting is often necessary. See choosing WordPress hosting.

Look for hosts with modern CPUs, NVMe storage, server-level caching, object caching and data centres near your audience. Managed WordPress hosts usually tune their servers for WordPress specifically.

Use a current PHP version

Newer PHP versions are significantly faster than older ones. Running an outdated version means slower page generation and missing security fixes. Check your PHP version in Tools > Site Health and upgrade through your hosting panel.

Test on staging first, as old plugins may not be compatible. My guide to upgrading PHP explains the process.

Optimise the database

Slow database queries increase TTFB for uncached pages. Large autoloaded options, missing indexes, bloated tables and heavy plugin queries are common causes. Query Monitor shows slow queries for each page.

Clean up old revisions, transients and leftover plugin tables, and reduce autoloaded data. Add object caching with Redis to store repeated query results. See optimizing the WordPress database.

Reduce plugin overhead

Some plugins run heavy code on every request, such as complex security checks, statistics, external API calls or poorly written queries. Each adds server time before the page can be sent.

Use Query Monitor to see which plugins take the most time and remove or replace heavy ones. My plugin bloat audit explains how.

Edge caching with a CDN

A CDN can cache full HTML pages at edge locations near visitors, so the server is not involved for most requests. Cloudflare APO, other edge caching services and some managed hosts’ CDNs do this. TTFB can drop dramatically for visitors worldwide.

Configure exclusions for dynamic pages such as cart and checkout, and make sure the cache is purged when content changes. See do you need a CDN.

DNS and connection time

Slow DNS providers add delay to the first visit. Using a fast DNS provider, such as Cloudflare or your CDN’s DNS, reduces lookup time. HTTP/2 and HTTP/3 reduce connection overhead, and modern TLS settings speed up the handshake.

These improvements are usually smaller than caching and hosting, but they add up. My guide to HTTP/2, HTTP/3 and Brotli explains the protocol side.

Redirect chains

Every redirect adds a full round trip before the final page loads. A visitor who types your domain without www and https might go through two or three redirects. Make sure every variation redirects directly to the final URL in one step.

Check internal links too. Links pointing to old URLs that redirect add delay for visitors and crawlers. Update them to point directly to the final URL. See 301 redirects explained.

Getting help

Diagnosing slow TTFB often requires looking at server logs, caching behaviour and database performance. I do this as part of my speed optimization service, and I can recommend or handle a hosting move if needed through my hosting and migration service.

For the next step after TTFB, see how to improve LCP on WordPress.

Key takeaways

  • TTFB includes DNS, connection, TLS and server generation time.
  • Page caching is the biggest TTFB improvement for most sites.
  • Better hosting and a current PHP version speed up uncached pages.
  • Edge caching through a CDN helps visitors far from the server.

Frequently asked questions

What is a good TTFB?

Around 0.8 seconds or less is a common guideline, though lower is better.

Does TTFB affect SEO?

Indirectly. It is not a Core Web Vital, but it delays LCP, which is.

Why is my TTFB slow only for some pages?

Those pages may not be cached, or run heavy queries. Check caching and Query Monitor.

Can a CDN fix slow TTFB?

It helps with distance and can cache full pages, but slow uncached pages still need server fixes.

Does object caching reduce TTFB?

Yes, for pages that cannot use page caching, such as logged-in or store pages.

Why is TTFB slow when I am logged in?

Logged-in WordPress users usually bypass the page cache, so every page is generated fresh with admin features loaded. Test TTFB in a private window to see what visitors experience, and use object caching to speed up the admin.

Free website audit

Get a free audit of your website

Tell me your URL and I'll send a short, prioritized list of the speed, SEO and security fixes that will make the biggest difference.

  • No obligation, no sales call
  • 5.0 rating on Google and Upwork
  • Reply within one business day
Written by Muhammad UsmanWeb Development Team Lead with 5+ years building WordPress, WooCommerce, Shopify and Wix websites. Experience · Certificates About me

More on Speed & Core Web Vitals

All Speed & Core Web Vitals articles

Have a project in mind?

Tell me what you're building and I'll reply with next steps and an estimate.