View contents
TTFB (Time to First Byte): Understanding Server Response Time
Introduction
Time to First Byte (TTFB) measures the time from when a user or client makes an HTTP request to when the first byte of the response arrives at the client’s browser. It’s a foundational performance metric that directly impacts every other timing metric—including FCP, LCP, and overall page load time.
TTFB is essentially a measure of your server’s responsiveness. A slow TTFB means users are waiting before they see anything at all, while everything else on your page—images, scripts, and styles—must wait in line.
What is TTFB?
TTFB measures the time between the navigation request and when the browser receives the first byte of the HTML response. This includes several network and server processes:
TTFB Components:
├── DNS Lookup: Resolving domain to IP (20-120ms)
├── TCP Connection: Establishing connection (20-100ms)
├── TLS Handshake: Secure connection setup (30-100ms)
├── Request Travel: Request reaching server (variable)
├── Server Processing: Generating response (variable)
└── Response Travel: First byte returning (variable)
What TTFB Measures
Page Load Timeline:
Navigation Start → DNS → TCP → TLS → Request → Server → First Byte → HTML → FCP → LCP
└─────────────────── TTFB ────────────────────┘
↑
Everything waits
Key insight: TTFB is the foundation. Every millisecond of TTFB directly delays FCP, LCP, and when users see content.
TTFB Thresholds
According to Google’s web.dev documentation, TTFB scores are categorized as:
✅ Good: ≤ 800 milliseconds
⚠️ Needs Improvement: 800 - 1800 milliseconds
❌ Poor: > 1800 milliseconds
Goal: Strive for TTFB under 800ms. For optimal user experience, aim for under 200ms.
Why is TTFB Important?
TTFB matters for several key reasons:
1. It’s the Starting Point
Nothing can render until the browser receives the HTML. TTFB determines when rendering can begin:
Slow TTFB (1.5s):
[──────────── Wait ────────────][FCP at 2.5s][LCP at 3.5s]
Fast TTFB (200ms):
[Wait][FCP at 1.0s][LCP at 2.0s]
└── Users see content 1.5 seconds sooner!
2. Multiplied Impact
TTFB affects every resource on your page:
- HTML document (primary impact)
- CSS stylesheets (blocks rendering)
- JavaScript files
- Images and fonts
- API calls
3. Server Health Indicator
High TTFB often indicates server problems:
- Overloaded server
- Slow database queries
- Inefficient server-side code
- Missing caching
- Poor hosting infrastructure
4. Affects Core Web Vitals
While TTFB isn’t a Core Web Vital itself, it directly impacts LCP:
- High TTFB → Late LCP → Poor ranking signal
- Server problems cascade to user experience
What Affects TTFB?
Several factors contribute to TTFB:
1. Geographic Distance
Physical distance between user and server:
User in Chile → Server in US East = 180ms+ latency
User in Chile → Server in Santiago = 20ms latency
Solution: Use a CDN with edge servers worldwide.
2. Server Processing Time
Backend work to generate the response:
Slow processing:
├── Complex database queries
├── Unoptimized server code
├── Heavy server-side rendering
├── Third-party API calls
└── Missing server caching
3. Network Latency
Time for data to travel:
Network Components:
├── DNS resolution (can be cached)
├── TCP connection establishment
├── TLS negotiation (can be optimized)
└── Physical data travel time
4. Hosting Infrastructure
Server hardware and configuration:
- Shared hosting (slow, inconsistent)
- VPS (better, dedicated resources)
- Dedicated servers (best performance)
- Edge computing (fastest, distributed)
5. No Caching Strategy
Without caching, servers regenerate responses repeatedly:
Without cache:
Request → Database → Process → Generate HTML → Send (500ms each time)
With cache:
Request → Check Cache → Send Cached Response (50ms)
Basic Best Practices
1. Use a CDN
Serve content from edge locations near users:
CDN Benefits:
├── Reduced latency (closer servers)
├── Cached content at edge
├── Reduced origin server load
├── Better availability
└── Often includes free SSL
Popular CDN options: Cloudflare, Fastly, AWS CloudFront, Vercel Edge.
2. Optimize Server Processing
Reduce work the server needs to do:
Server Optimization:
├── Cache database queries
├── Optimize SQL queries
├── Use efficient algorithms
├── Reduce third-party calls
└── Profile and fix bottlenecks
3. Enable HTTP Caching
Configure proper cache headers:
Cache-Control: public, max-age=31536000, immutable
For static assets (CSS, JS, images) and:
Cache-Control: public, max-age=0, must-revalidate
For HTML pages that may change.
4. Use HTTP/2 or HTTP/3
Modern protocols reduce connection overhead:
HTTP/1.1: Separate connection per request
HTTP/2: Multiplexed connections
HTTP/3: QUIC protocol (faster handshakes)
5. Optimize TLS
Reduce TLS handshake time:
- Use TLS 1.3 (faster handshake)
- Enable session resumption
- Use OCSP stapling
- Optimize certificate chain
TTFB vs Other Metrics
| Metric | What it Measures | Relationship to TTFB |
|---|---|---|
| TTFB | Server response time | Foundation metric |
| FCP | First content painted | Delayed by TTFB |
| LCP | Largest content painted | Delayed by TTFB |
| FID/INP | Interactivity | Indirectly affected |
Key insight: TTFB is a diagnostic metric that helps identify server-side problems. Fix TTFB to improve all other metrics.
How to Check with UXR SEO Analyzer
The UXR SEO Analyzer extension helps you monitor TTFB:
- Install the UXR SEO Analyzer extension in Chrome
- Navigate to any page on your website
- Open the extension
- Go to the “Performance” tab
- Check the “TTFB” evaluator
The extension will show:
- Current TTFB value
- Whether it meets the 800ms threshold
- Server response indicators
- Suggestions for improvement
Next Steps
Want to master all advanced TTFB optimization techniques? Read our complete TTFB optimization guide where we cover:
- CDN configuration strategies
- Server caching techniques
- Database optimization
- Edge computing benefits
- HTTP/2 and HTTP/3 implementation
- Server-side rendering optimization
Related Articles:
- FCP Explained - First Contentful Paint fundamentals
- LCP Explained - Largest Contentful Paint basics
- Server Response Guide - Optimizing backend performance
References
This article cites the following authoritative sources:
[1] web.dev: Time to First Byte (TTFB) https://web.dev/articles/ttfb Official Google documentation defining TTFB. Explains what contributes to TTFB (redirect time, service worker startup, DNS lookup, connection/TLS negotiation, and request to response start), the 800ms threshold, and how TTFB impacts other metrics.
[2] Chrome Developers: Lighthouse TTFB Audit https://developer.chrome.com/docs/lighthouse/performance/time-to-first-byte Technical documentation on how Lighthouse measures and scores TTFB. Includes recommendations for reducing TTFB through caching, CDNs, and server optimization.
[3] MDN Web Docs: Navigation Timing API
https://developer.mozilla.org/en-US/docs/Web/API/Navigation_timing_API
Technical reference for measuring TTFB using performance.timing.responseStart - performance.timing.navigationStart in browsers. Essential for understanding how TTFB is captured in real user monitoring.
Additional Resources
- PageSpeed Insights - Test your page’s TTFB
- WebPageTest - Detailed server timing analysis
- Chrome User Experience Report - Real-world TTFB data
Note: This article is part of our SEO analysis series. Explore all articles in the Performance SEO Hub.
Sources: web.dev (TTFB), Chrome Developers (Lighthouse), MDN Web Docs (Navigation Timing API)