Loadzen

← All articles

Performance5 min readReece Crowther

What is Time to First Byte (TTFB) and How to Improve It

TTFB is the time between a browser requesting a page and receiving the first byte of the response. Here is what causes slow TTFB and how to fix it.

What is Time to First Byte?

Time to First Byte (TTFB) measures how long it takes from when a browser sends an HTTP request to when it receives the first byte of the server's response.

Google recommends TTFB under 800ms. Under 200ms is excellent. Above 1.8 seconds is poor.

TTFB is not a Core Web Vital, but it is foundational — everything else (LCP, FCP, load time) cannot start until TTFB completes. A slow TTFB makes every other metric harder to improve.


What affects TTFB?

TTFB is the sum of several delays:

1. DNS lookup — resolving your domain name to an IP address.

2. TCP connection — establishing a connection to the server.

3. TLS handshake — the security negotiation for HTTPS connections.

4. Server processing time — how long the server takes to generate the response.

On a typical dynamic site (WordPress, WooCommerce, Shopify-alternative), server processing time is the largest contributor. The server receives the request, queries the database, runs PHP, and builds the HTML before sending a single byte back.


How to measure TTFB

In Chrome DevTools: open the Network tab, reload the page, click the first HTML document request, and look at the "Waiting (TTFB)" row in the Timing section.

In PageSpeed Insights: TTFB appears as "Server response times" under Diagnostics.

You can also check TTFB from multiple global locations using tools like WebPageTest — this reveals whether slow TTFB is a global problem or only affects visitors far from your server.


How to fix slow TTFB

1. Enable full-page caching

This is almost always the highest-impact fix for dynamic sites. A cached page is served directly from memory — no PHP execution, no database query. TTFB drops from 500–2000ms to under 50ms.

  • WordPress: Use WP Rocket, LiteSpeed Cache, or W3 Total Cache.
  • WooCommerce: Enable caching but exclude cart, checkout, and account pages.
  • Next.js / custom apps: Use ISR (Incremental Static Regeneration) or serve pre-rendered HTML.
  • 2. Use a CDN with edge caching

    A CDN serves cached pages from servers geographically close to visitors, eliminating the latency of routing traffic to a single origin server. Cloudflare's free tier provides this for static assets. For full-page HTML caching at the edge, Cloudflare Pro or Enterprise is needed.

    3. Add object caching (Redis or Memcached)

    Database queries are often the bottleneck inside server processing time. Object caching stores the results of expensive database queries in memory so they do not need to be repeated.

    On managed WordPress hosts, Redis is often available as an add-on. For self-managed servers, install Redis and use the Redis Object Cache plugin.

    4. Optimize your database

  • Remove unnecessary post revisions, expired transients, and draft content.
  • Ensure database tables have appropriate indexes.
  • For large sites, consider a read replica database for query-heavy pages.
  • 5. Upgrade your hosting

    Some slow TTFB problems cannot be solved without better infrastructure. Signs you have outgrown your hosting:

  • TTFB above 1 second even after enabling caching.
  • TTFB spikes during traffic peaks.
  • Your host's server is geographically far from most of your visitors.
  • Moving from shared hosting to a VPS or managed WordPress host (Kinsta, WP Engine) typically reduces TTFB by 50–80%.

    6. Reduce DNS lookup time

    Use a fast DNS provider. Cloudflare DNS (1.1.1.1) and Google Public DNS (8.8.8.8) are consistently the fastest globally. DNS propagation time is not something you control, but your DNS provider's query response time is.

    Enable DNS prefetching for third-party origins your page loads from:

    ```html

    ```


    TTFB and SEO

    Google's Core Web Vitals report in Search Console does not directly include TTFB, but Google has confirmed it considers server response time as part of the overall page experience assessment. More directly, a slow TTFB delays Googlebot when it crawls your pages, reducing the number of pages it can index per crawl session.

    Run a free check with Loadzen to see your current TTFB alongside your full PageSpeed report.

    Related guide

    Website Performance Optimisation Guide →

    Keep reading

    Check your own site

    Run a free speed check with Loadzen and get a prioritized fix plan for your specific platform.

    Run free speed check