From Invisible to #1 on Google Maps. · 14 years experience · Book your free audit claim yours →
Technical SEO

TTFB Optimization: How to Fix a Slow Server Response

Time To First Byte decides how much of your LCP budget is left before the page even starts to render. Here is how to measure it and cut it, in priority order.

For: Local business owners, marketers, and developers who maintain service-business websites

Questions this guide answersQuestions answered in this guide: What is a good TTFB for SEO? Is TTFB a Core Web Vital or a ranking factor? Why is my TTFB slow even though my site is small? Why do PageSpeed Insights and my own test show different TTFB?Questions this guide answers5 questions01What is a good TTFB for SEO?–Google's web.dev guidance treats 800 milliseconds or less as good,measured at the 75th percentile of real visits, and anything over 1,800milliseconds as poor. Aim well below the ceiling. Static pages serve…02Is TTFB a Core Web Vital or a ranking factor?+03Why is my TTFB slow even though my site is small?+04Why do PageSpeed Insights and my own test show differentTTFB?+
800 msGood TTFB threshold at the 75th percentile
1.8 sAbove this, TTFB is rated poor
2.5 sLCP budget that a slow first byte consumes
600 msLighthouse flags server response above this

Every page on your site starts the same way: a browser or crawler asks for a URL and waits. Until the first byte of the HTML comes back, nothing renders, nothing is discovered, and no Core Web Vital can begin to improve. That wait is Time To First Byte, and for most local service sites it is the most overlooked line item in a speed audit, because it hides behind the hosting bill instead of behind the code.

This guide explains what TTFB actually measures, why it quietly caps your Largest Contentful Paint and your crawl efficiency, and how to cut it in the order that pays back fastest. It ends with a prioritized checklist you can hand to a developer or a hosting provider and work through in a week.

Best use case: Thresholds come from Google's web.dev guidance and can change, so confirm the current values before you set targets.

What TTFB measures, and what it does not

TTFB is the time from the moment a user starts a navigation to the moment the first byte of the response arrives. In the Navigation Timing API that is the gap between the start of navigation and responseStart. It is not a single server metric. It is the sum of everything that happens before the HTML begins to stream.

That sum includes several distinct phases:

  • Redirects. Every hop, such as http to https, non-www to www, or a trailing-slash rewrite, adds a full round trip before the real page is even requested.
  • DNS lookup. Resolving the hostname to an IP address. A slow or distant DNS provider adds delay on every cold visit.
  • Connection and TLS. The TCP handshake plus the TLS negotiation. These cost round trips, so physical distance to the server matters directly.
  • Request and server processing. The time the origin or edge spends building the response: running application code, querying a database, calling third-party APIs, or simply reading a file.
  • First byte travel. The time for that first piece of the response to reach the visitor.

Two clarifications prevent most confusion. First, TTFB is not one of the three Core Web Vitals. Google treats it as a diagnostic that influences the metrics that are, chiefly LCP. Second, a low TTFB does not mean the page is fast. It only means the wait before rendering can start was short. A site can have an excellent TTFB and still load slowly because of heavy images or render-blocking scripts.

Why TTFB gates LCP and crawling

Think of TTFB as the fixed cost you pay before any other optimization counts. The browser cannot discover your stylesheet, your hero image, or your fonts until it has received and begun parsing the HTML. If the first byte arrives at 1.6 seconds, you have already spent most of the 2.5 second budget that Google treats as a good LCP, and the image, CSS, and rendering work all still lie ahead.

This is why teams that compress images and defer scripts sometimes see almost no LCP movement. If the document itself is slow to arrive, front-end tuning is working with whatever time is left over. Fixing the server side first frees up budget for every later step. A related technique, 103 Early Hints, lets a server send preload hints for critical assets while it is still generating the page, which is another way TTFB work and LCP work overlap.

The crawling effect is just as important and gets less attention. Googlebot adapts how fast it requests pages to how well your server responds. Google's own crawl documentation notes that when a server responds slowly or returns errors, the crawl rate drops. For a small local business site with a few dozen pages this rarely limits indexing. For a site with hundreds of location pages, service pages, and blog articles, a slow origin can mean new and updated pages are discovered and refreshed more slowly than you want.

Targets: what counts as good

Google's web.dev guidance, which is the most widely cited reference, sets these thresholds measured at the 75th percentile of real visits:

  • Good: 800 milliseconds or less.
  • Needs improvement: between 800 milliseconds and 1,800 milliseconds.
  • Poor: more than 1,800 milliseconds.

The 75th percentile matters. It means that three quarters of your real visits must be at or under the target. An average of 500 milliseconds can hide a long tail of slow visits from distant regions, cold caches, or mobile networks. Always judge TTFB by percentile, not by the average on a single test run.

Treat 800 milliseconds as a ceiling, not a goal. A static page served from a CDN edge should reach the first byte in well under 200 milliseconds for most visitors, and a good dynamic site can stay under 400. Because TTFB consumes LCP budget, every 100 milliseconds you recover is a 100 millisecond gain in LCP as well, provided nothing else changes.

Lighthouse applies a stricter lab check. Its audit named "Reduce initial server response time" flags the main document when the server response takes longer than 600 milliseconds. Passing that audit in a lab test is a useful floor, but the field number is the one that counts.

Diagnose first: find which phase is slow

Because TTFB is a sum, the fix depends on which phase dominates. Guessing leads to expensive hosting upgrades that do nothing. Spend ten minutes breaking the number apart.

Open the Network panel in Chrome DevTools, click the main document request, and read the Timing tab. It separates queueing, DNS, initial connection, SSL, request sent, and "Waiting for server response." That last line is your server processing plus network latency to first byte. For a command-line view, curl -w with timing variables such as time_namelookup, time_connect, time_appconnect, and time_starttransfer gives the same breakdown and is easy to repeat.

Then read the pattern:

  • Large wait for server response, small everything else. The origin is slow. Look at caching, application code, database queries, and hosting capacity.
  • Large connect and SSL time. The server is geographically far from the tester or the TLS setup is poor. A CDN and modern TLS settings help most.
  • Large DNS time. Move DNS to a fast anycast provider and check for long CNAME chains.
  • Several requests before the real page. You have a redirect chain. Use a tool that shows every hop and collapse it to one.
  • Fast on a repeat request, slow on the first. You have a cold cache, and your cache hit ratio is the real problem.

Test from more than one location. A page that responds in 250 milliseconds from your office near the server can take 1.5 seconds for a visitor on another continent, and for a local business that serves one metro area, the relevant test location is that metro, on a mobile connection.

Network-layer fixes: redirects, DNS, TLS, and the CDN

These changes usually take hours, not weeks, and they help every page at once.

Collapse redirects. A common pattern is http://example.com redirecting to https://example.com, then to https://www.example.com, then to a trailing-slash URL. That is three extra round trips before the HTML request even begins. Configure the server so any variant goes to the final canonical URL in a single 301. Update internal links, sitemaps, and canonical tags to point at the final URL so that crawlers and visitors almost never hit a redirect at all. Our guide to HTTP status codes for SEO explains which redirect type to use at each step.

Put a CDN in front of the site. A content delivery network terminates the connection at a location close to the visitor, so DNS, TCP, and TLS handshakes all become short. It can also serve cached HTML directly from the edge, which removes the origin from the request entirely. For a business with customers in one region, choose a provider with strong presence in that region. Enable HTTP/2 or HTTP/3, TLS 1.3, and session resumption, which reduce handshake round trips for returning visitors.

Use fast DNS. A managed anycast DNS service resolves from nearby nodes. Keep the record chain short and set a sensible TTL so resolvers can cache your answers rather than looking them up repeatedly.

Cache HTML at the edge, carefully. Most CDNs cache images and scripts by default but treat HTML as dynamic. For pages that are the same for every visitor, such as service pages, location pages, and blog articles, send headers that allow shared caches to store the document. A typical pattern is Cache-Control: public, max-age=0, s-maxage=3600, stale-while-revalidate=86400. Browsers revalidate each time, the CDN serves a cached copy for an hour, and it can serve a stale copy while it quietly fetches a fresh one. Never cache pages containing personalized content, carts, or logged-in state without varying correctly.

Origin fixes: hosting, caching, code, and databases

When the "Waiting for server response" line is large even on a CDN miss, the origin itself needs work. Take these in order of effort versus payoff.

Generate pages ahead of time. The most reliable way to get a fast first byte is to avoid building the page at request time. Static site generation and incremental regeneration produce HTML files once and serve them as files. For a marketing site, a blog, or a directory of location pages, this is usually the right architecture. Where content changes occasionally, regenerate on publish or on a schedule instead of on every visit.

Add a full-page cache. On a platform such as WordPress, a page cache plugin or a server-level cache stores finished HTML and bypasses PHP and the database for anonymous visitors. This single change often turns a 1.5 second response into a response in the low hundreds of milliseconds. Pair it with an object cache such as Redis for the pages that cannot be fully cached.

Right-size the hosting. Cheap shared hosting puts your site on a crowded machine where a neighbor's traffic spike becomes your slow response. If measurements show high and erratic server wait even for simple pages, move to a managed host, a VPS with dedicated resources, or a platform built around edge delivery. Check that the server runs a current PHP or runtime version with an opcode cache enabled, since older versions are meaningfully slower.

Trim the backend work. Profile what happens during a request. Common offenders include plugins that run on every page load, uncached remote API calls such as reviews or weather widgets fetched during rendering, and verbose theme code that queries the database dozens of times. Move third-party calls out of the critical path by fetching them asynchronously in the browser or caching their results on the server.

Optimize the database. Slow queries are a classic hidden cause. Enable the slow query log, look for queries without a usable index, and fix repeated queries inside loops. Clear out accumulated junk such as old post revisions, expired transients, and oversized option tables. Even modest cleanup can cut tens or hundreds of milliseconds from uncached requests.

Measuring TTFB: field data versus lab data

Lab tools and field data answer different questions, and mixing them up causes bad decisions.

Field data comes from real visits. The Chrome User Experience Report, surfaced in PageSpeed Insights and the Core Web Vitals report in Search Console, shows what your actual visitors experienced at the 75th percentile, including their devices, networks, and locations. This is the number to treat as the truth. Its limits are that it needs enough traffic to appear and it lags by weeks, so it is poor for checking whether yesterday's change worked.

Lab data comes from a controlled test, such as Lighthouse or WebPageTest. It is repeatable and instant, which makes it ideal for testing a fix, comparing before and after, and reading the waterfall. Its limit is a single location and simulated network, so one result can mislead.

A practical workflow looks like this:

  • Use field data to decide whether you have a TTFB problem and which page types or regions suffer.
  • Use lab and command-line tests to find the cause and verify a fix, running each test several times and comparing medians, not single runs.
  • Add real user monitoring with the web-vitals JavaScript library, which reports TTFB from actual sessions to your analytics, so you can see changes within days instead of weeks.
  • Segment results by cache status. Log whether the response was a CDN hit or miss, since a healthy site can still show a bad overall percentile if too many requests miss the cache.

Remember that field TTFB includes redirects and connection setup for real users, while many lab tests measure only the final document request. If the two disagree, redirects and geography are the first things to check. For a broader view of how speed fits into overall site health, run a website SEO audit and review the technical findings alongside the performance numbers.

The prioritized TTFB checklist

Work through these in order. The sequence puts quick, high-impact changes first and expensive changes last.

  1. Baseline. Record field TTFB at the 75th percentile for your key page types from PageSpeed Insights or Search Console, and a lab breakdown from DevTools or curl.
  2. Remove redirect chains. Make every URL variant resolve to the canonical URL in one 301, and update internal links, canonicals, and sitemaps to match.
  3. Enable a CDN with HTTP/2 or HTTP/3 and TLS 1.3, choosing a provider close to your customers.
  4. Cache HTML at the edge for public pages using s-maxage and stale-while-revalidate, and confirm a high cache hit ratio.
  5. Add a page cache at the origin so anonymous requests never reach the application or database.
  6. Move DNS to a fast anycast provider and shorten record chains.
  7. Update the runtime to a current supported version with opcode caching enabled.
  8. Profile the backend. Remove or defer plugins and third-party calls that run on every request.
  9. Fix the database. Review the slow query log, add missing indexes, and clean accumulated bloat.
  10. Upgrade or move hosting only if the earlier steps leave the server wait high and erratic.
  11. Move to static or incremental generation for content pages that rarely change.
  12. Monitor. Add real user monitoring, alert on a regression above 800 milliseconds, and re-check after every major plugin, theme, or hosting change.

After the server side is healthy, check how the rest of your page loads and whether answer engines can read it using the AEO check. Speed is a foundation, and fast pages still need clear, useful content to earn visibility.

FAQ

What is a good TTFB for SEO?

Google's web.dev guidance treats 800 milliseconds or less as good, measured at the 75th percentile of real visits, and anything over 1,800 milliseconds as poor. Aim well below the ceiling. Static pages served from a CDN edge can respond in a couple hundred milliseconds, which leaves more of the 2.5 second LCP budget for images and rendering.

Is TTFB a Core Web Vital or a ranking factor?

TTFB is not one of the three Core Web Vitals, and Google has not described it as a standalone ranking factor. It matters indirectly because it consumes time from Largest Contentful Paint, which is a Core Web Vital, and because a slow server can reduce how quickly Googlebot crawls your pages and how well visitors convert.

Why is my TTFB slow even though my site is small?

Small sites are often on crowded shared hosting, run uncached dynamic pages, or sit behind redirect chains. Size is rarely the cause. Check the DevTools timing breakdown to see whether the delay is in DNS, connection, redirects, or server waiting, then fix that phase instead of upgrading hosting blindly.

Why do PageSpeed Insights and my own test show different TTFB?

PageSpeed Insights shows field data from real Chrome users at the 75th percentile, including redirects, distance, and slow networks, alongside a single simulated lab run. A test from your own location usually hits a nearby, warm connection. Field data reflects what visitors experience, so use it to judge the problem and lab runs to diagnose it.

Will a CDN fix a slow TTFB by itself?

Only partly. A CDN shortens DNS, connection, and TLS time by serving from nearby locations, but if HTML is not cacheable the request still reaches your slow origin on every visit. Pair it with cache headers that let the edge store public pages, and with origin fixes for the cache misses.

Turn this into a practical SEO action plan

Use RankLocalToday tools to check rankings, diagnose website issues, and prioritize the next organic traffic move.

Get your SEO plan →