TTFB Explained: Why Server Response Time Is Your First Hurdle
Time to First Byte sets the ceiling for every other performance metric. Learn what causes slow TTFB, how to diagnose it, and actionable fixes for any stack.
Before your page can render a single pixel, before LCP can even start its timer, your browser has to wait for the server to respond. That wait is called Time to First Byte (TTFB), and it's the performance ceiling that every other metric lives under.
What TTFB Measures
TTFB is the time from when the browser sends an HTTP request to when it receives the first byte of the response. It includes:
- DNS lookup — resolving the domain name to an IP
- TCP connection — establishing the connection
- TLS negotiation — setting up HTTPS encryption
- Server processing — the server actually generating the response
- Network transit — the response traveling back to the client
TTFB Thresholds
| TTFB | Rating |
|---|---|
| ≤ 800ms | Good |
| 800ms – 1800ms | Needs Improvement |
| > 1800ms | Poor |
Why TTFB Matters More Than You Think
TTFB is a compounding metric. A slow TTFB doesn't just delay the page by that amount — it delays everything:
- LCP can't start measuring until the HTML arrives
- Render-blocking CSS and JS can't be fetched until the HTML is parsed
- Every subsequent resource request adds another TTFB of its own
A 500ms TTFB on the HTML document can easily result in a 2-3 second delay to LCP.
Common Causes of Slow TTFB
1. Slow Database Queries
The #1 cause of server-side delays. Unindexed queries, missing joins, and N+1 problems can turn a 10ms query into a 2-second query.
Fix: Add database indexes, use query profiling (EXPLAIN in PostgreSQL/MySQL), and implement query caching.
2. Distant Server Location
If your server is in Virginia and your users are in Sydney, every request travels ~15,000 km each way. Physics can't be optimized.
Fix: Use a CDN with edge caching, or deploy to multiple regions.
3. No Server-Side Caching
Regenerating the same HTML on every request is wasteful. If a page doesn't change between requests, cache the response.
Fix: Implement page-level caching with tools like Varnish, Redis, or your framework's built-in cache (e.g., Next.js ISR).
4. Heavy Server-Side Rendering
Complex SSR with data fetching from multiple APIs can be slow, especially under load.
Fix: Use streaming SSR, parallelize data fetching, and cache API responses.
5. Shared Hosting and Overcrowded Servers
Budget hosting plans pack hundreds of sites on a single server. When your neighbor gets a traffic spike, your TTFB suffers.
Fix: Upgrade to dedicated hosting, VPS, or managed platforms like Vercel, Netlify, or Railway.
6. Missing HTTP/2 or HTTP/3
Older servers still on HTTP/1.1 can't multiplex requests, causing head-of-line blocking.
Fix: Enable HTTP/2 (or HTTP/3 with QUIC) on your web server and CDN.
How to Diagnose TTFB Issues
Chrome DevTools Network Tab
- Open DevTools → Network
- Click on the HTML document request
- Look at the "Timing" tab — TTFB is labeled as "Waiting (TTFB)"
curl from Terminal
curl -o /dev/null -s -w "TTFB: %{time_starttransfer}s\n" https://yoursite.com
WebPageTest
Run a test from multiple locations to see how TTFB varies geographically. Look at the "First Byte" metric in the waterfall chart.
TTFB Optimization Strategies by Stack
WordPress
- Install a page caching plugin (WP Rocket, W3 Total Cache)
- Use object caching with Redis
- Move to managed WordPress hosting (Kinsta, WP Engine)
- Disable unnecessary plugins that run on every request
Next.js
- Use Static Generation (SSG) for pages that don't change often
- Use Incremental Static Regeneration (ISR) for semi-dynamic pages
- Deploy to Vercel's Edge Network for automatic edge caching
- Use
unstable_cacheor Reactcache()for server-side data
Django / Rails / Laravel
- Implement full-page caching with Redis or Memcached
- Use database connection pooling
- Profile with tools like Django Debug Toolbar or Rack Mini Profiler
- Add a reverse proxy (Nginx, Caddy) in front of the application server
Static Sites
- Deploy to a CDN (Cloudflare Pages, Netlify, Vercel)
- Use Brotli compression
- Set long cache headers for immutable assets
The Global TTFB Problem
TTFB varies dramatically by user location. A site hosted on a single origin server might have:
| User Location | TTFB |
|---|---|
| Same city | 50ms |
| Same continent | 200ms |
| Opposite hemisphere | 500ms+ |
This is why CDNs and edge computing are essential for global audiences.
TTFB and SEO
While Google doesn't use TTFB as a direct ranking factor, it indirectly affects rankings by:
- Increasing LCP (which IS a ranking factor)
- Slowing Googlebot's crawl efficiency
- Reducing the number of pages Google crawls per session
Sites with consistently slow TTFB get crawled less frequently, meaning new content takes longer to appear in search results.
Monitor TTFB Continuously
TTFB can degrade gradually as your database grows, traffic increases, or hosting performance changes. Set up automated monitoring to catch slowdowns before they impact users.
Ready to stop wasting ad spend?
Track your landing page performance, monitor Core Web Vitals, and calculate exactly how much slow pages cost you.
Start Free — No Credit Card