Time to First Byte (TTFB) measures how long it takes your server to respond to a request. A slow TTFB delays everything else, making it one of the most important performance metrics to optimize.
What is TTFB?
TTFB is the time between a browser requesting a page and receiving the first byte of data. It includes DNS lookup, TCP connection, SSL negotiation, and server processing time.
Target: Under 600ms (ideally under 200ms)
What Causes Slow TTFB?
Server-Side Issues
- Slow database queries
- Unoptimized server configuration
- Insufficient server resources
- No server-side caching
Network Issues
- Server location far from users
- DNS resolution delays
- No CDN in use
How to Improve TTFB
1. Upgrade Your Hosting
Cheap shared hosting is often the bottleneck. Consider:
- VPS or dedicated servers
- Managed WordPress hosting (WP Engine, Kinsta)
- Cloud hosting (AWS, Google Cloud)
2. Enable Server-Side Caching
- Use Redis or Memcached for object caching
- Enable page caching (full HTML)
- Use opcode caching for PHP
3. Optimize Database
- Add indexes to frequently queried columns
- Clean up old data (revisions, transients)
- Optimize slow queries
4. Use a CDN
CDNs cache content at edge locations worldwide, reducing distance to users.
5. Keep Software Updated
PHP 8.x is significantly faster than PHP 7.x. Keep your CMS and plugins updated.
Measuring TTFB
- Chrome DevTools: Network tab shows "Waiting" time
- WebPageTest: Shows detailed TTFB breakdown
- GTmetrix: Includes TTFB in performance metrics
TTFB Benchmarks
| Rating | TTFB |
|---|---|
| Excellent | < 200ms |
| Good | 200-500ms |
| Needs Work | 500-1000ms |
| Poor | > 1000ms |
Related: Website Speed Optimization Guide
0 comments