What is TTFB? SEO Guide for Beginners
Learn what TTFB (Time to First Byte) means in SEO, why it matters, and how to use it to improve your search rankings.
Time to First Byte (TTFB) is a performance metric that measures the time between the browser requesting a page and receiving the first byte of data from the server. It reflects how quickly your server processes a request and starts delivering content. Google recommends a TTFB of 800 milliseconds or less, though for truly fast sites, you should aim for under 200ms.
Why TTFB Matters for SEO
TTFB is the foundation of every other performance metric. Your LCP cannot be fast if your server takes 2 seconds just to start sending data. Your INP suffers if the page takes forever to initially load because JavaScript execution is delayed. Every millisecond of TTFB pushes back the entire loading timeline.
While TTFB is not an official Core Web Vital, Google has explicitly stated it is a diagnostic metric that impacts Core Web Vitals scores. It also affects crawl efficiency. When Googlebot encounters slow TTFB, it reduces its crawl rate to avoid overloading your server. This means fewer pages crawled per session and slower discovery of new content.
I have measured the difference firsthand. When I moved my blog from a server-rendered framework to static HTML served from a CDN, TTFB dropped from 400ms to under 50ms. That single change improved my LCP by nearly a full second and pushed several pages from "needs improvement" to "good" in Core Web Vitals.
How TTFB Works
TTFB measures three sequential phases. First, the DNS lookup translates your domain name to an IP address. Second, the TCP/TLS connection establishes a secure link between the browser and server. Third, the server processes the request (running database queries, executing server-side code, generating HTML) and sends back the first byte of the response.
For static sites, the server processing phase is almost zero because the HTML is pre-built and just needs to be read from disk or cache. For dynamic sites running WordPress, Django, or Rails, the server has to execute code, query databases, and assemble the HTML on every request, which can add hundreds of milliseconds or more.
Geographic distance also plays a major role. If your server is in New York and a user is in Tokyo, the physical distance adds latency to every phase of the connection. This is where CDNs become critical, placing cached copies of your content on servers around the world.
How to Improve TTFB on Your Site
Use a CDN - A Content Delivery Network like Cloudflare, Fastly, or AWS CloudFront caches your content on edge servers worldwide. Users connect to the nearest edge server instead of your origin, dramatically reducing TTFB for visitors outside your server's region.
Enable server-side caching - For dynamic sites, cache rendered HTML output using Varnish, Redis, or your framework's built-in caching. A cached response can be served in single-digit milliseconds instead of hundreds.
Optimize database queries - Slow database queries are a leading cause of high TTFB on dynamic sites. Use query analysis tools (EXPLAIN in PostgreSQL, slow query log in MySQL) to identify and optimize expensive queries. Add indexes where needed.
Consider static site generation - Frameworks like Astro, Next.js (static export), and Hugo pre-build your pages at deploy time. The server just serves a file from disk or CDN cache, eliminating server-side processing entirely and achieving TTFB under 100ms.
Upgrade your hosting - Shared hosting plans often have slow I/O, limited CPU, and overcrowded servers. Moving to a VPS, dedicated server, or managed hosting platform like Vercel, Netlify, or Cloudflare Pages can cut TTFB significantly.
Common Mistakes to Avoid
Testing TTFB only from your own location: Your TTFB might be 50ms when you are near the server, but 800ms for users across the globe. Use tools like WebPageTest or KeyCDN Performance Test that let you test from multiple locations worldwide.
Ignoring TTFB for API calls: If your page makes client-side API calls during rendering, those requests have their own TTFB. A fast HTML response does not help if your JavaScript then waits 2 seconds for API data before rendering content.
Adding too many WordPress plugins: Each PHP plugin adds processing time to every request. Sites with 30+ active plugins routinely see TTFB above 1 second. Audit and remove plugins you do not actively use, and consider replacing heavy plugins with lighter alternatives.
Key Takeaways
- TTFB measures how quickly your server starts responding. It directly impacts LCP, INP, and how aggressively Google crawls your site.
- Use a CDN to serve content from edge locations close to your users and reduce geographic latency.
- Server-side caching and static site generation are the most effective ways to achieve consistently low TTFB.
- Test from multiple geographic locations to understand the real experience for your global audience.
Related Articles
What are Backlinks? SEO Guide for Beginners
Learn what backlinks mean in SEO, why they matter, and how to use them to improve your search rankings.
What are Canonical Tags? SEO Guide for Beginners
Learn what canonical tags mean in SEO, why they matter, and how to use them to improve your search rankings.
What are Core Web Vitals? SEO Guide for Beginners
Learn what Core Web Vitals mean in SEO, why they matter, and how to use them to improve your search rankings.