How to Reduce Server Response Time (TTFB) for Better SEO
Learn how to reduce server response time and improve TTFB. Faster server response means better Core Web Vitals and improved search rankings.
Time to First Byte (TTFB) measures how long users wait before receiving the first byte of response from your server. A slow TTFB delays everything else, directly impacting Core Web Vitals and SEO.
Here’s how to diagnose and fix server response time issues.
What Is TTFB?
TTFB (Time to First Byte) measures the time between:
- User’s browser sends request
- Browser receives first byte of response
TTFB includes:
- DNS lookup time
- TCP connection time
- TLS negotiation (HTTPS)
- Server processing time
- Network latency
TTFB Thresholds
| TTFB | Rating |
|---|---|
| <200ms | Good |
| 200-500ms | Moderate |
| >500ms | Slow |
Why TTFB Matters for SEO
Impact on Core Web Vitals
TTFB directly affects LCP:
- Slow TTFB = Late start on loading
- Can’t have good LCP with bad TTFB
- Google explicitly mentions TTFB in LCP guidance
Impact on Crawling
- Google crawls less on slow sites
- Crawl budget gets wasted on delays
- New content indexed slower
User Experience
- Users perceive site as slow
- Higher bounce rates
- Lower conversions
Measuring TTFB
PageSpeed Insights
Shows TTFB under “Server response time” in Diagnostics.
Chrome DevTools
- Open DevTools > Network tab
- Load page
- Click on main document
- Check “Waiting (TTFB)” in Timing
WebPageTest
Provides detailed TTFB breakdown:
- DNS lookup
- Initial connection
- SSL negotiation
- Time to first byte
Command Line
curl -o /dev/null -w "TTFB: %{time_starttransfer}s\n" https://example.com
Causes of Slow TTFB
1. Slow Server/Hosting
Symptoms:
- Consistently slow TTFB on all pages
- TTFB doesn’t vary much by page
Common issues:
- Shared hosting with limited resources
- Overloaded servers
- Undersized server instances
2. Unoptimized Database
Symptoms:
- Slow TTFB on dynamic pages
- Fast TTFB on static assets
Common issues:
- Missing database indexes
- Unoptimized queries
- N+1 query problems
- Large database without optimization
3. No Caching
Symptoms:
- Every request hits the database
- TTFB high even for repeat visits
Common issues:
- No server-side caching
- No object caching
- Cache not configured correctly
4. Geographic Distance
Symptoms:
- TTFB varies by user location
- Users far from server experience worst TTFB
Common issues:
- Single server location
- No CDN
- CDN misconfigured
5. SSL/TLS Overhead
Symptoms:
- Significant time in “SSL” phase
- High TTFB specifically on HTTPS
Common issues:
- Old TLS version
- Suboptimal SSL configuration
- Missing OCSP stapling
How to Reduce TTFB
1. Upgrade Hosting
Options by need:
| Traffic Level | Recommended Hosting |
|---|---|
| Low | Quality shared hosting |
| Medium | VPS or managed WordPress |
| High | Dedicated or cloud servers |
| Enterprise | Auto-scaling cloud infrastructure |
Quality hosting providers:
- Vercel, Netlify (static/JAMstack)
- Cloudflare Pages (static)
- AWS, Google Cloud, Azure (scalable)
- WP Engine, Kinsta (WordPress)
2. Implement Server Caching
Full-page caching:
- Cache entire HTML response
- Serve cached version to repeat visitors
- Dramatically reduces TTFB
WordPress example with WP Super Cache:
// Cached response served in <10ms vs 500ms+ uncached
Object caching:
- Cache database query results
- Redis or Memcached
- Reduces repeated database load
Varnish/FastCGI Cache:
- Sits in front of application
- Serves cached responses instantly
- Can reduce TTFB to <50ms
3. Optimize Database
Add indexes:
-- Before: Full table scan on every query
-- After: Index lookup in milliseconds
CREATE INDEX idx_posts_date ON posts(created_at);
Optimize queries:
- Use EXPLAIN to find slow queries
- Avoid SELECT * (select specific columns)
- Fix N+1 queries with eager loading
Regular maintenance:
- Remove post revisions (WordPress)
- Clean transient data
- Optimize tables
4. Use a CDN
A CDN caches content closer to users:
How CDN helps TTFB:
- User requests page
- CDN edge server (nearby) responds
- If cached, instant response
- If not cached, fetches from origin
CDN options:
- Cloudflare (free tier available)
- Fastly
- AWS CloudFront
- Akamai
5. Optimize SSL/TLS
Enable HTTP/2 or HTTP/3:
- Multiplexing reduces connections
- Header compression
- Better performance on TLS
Enable OCSP Stapling:
- Server pre-fetches certificate status
- Eliminates extra round-trip
Use TLS 1.3:
- Faster handshake (1 round-trip vs 2)
- Better security
6. Reduce Server Processing
Use efficient languages/frameworks:
- Pre-compiled > interpreted
- Lightweight frameworks for simple sites
Precompute what you can:
- Static site generation
- Pre-render popular pages
- Build-time computation
Example with Next.js:
// Instead of rendering on every request
export async function getStaticProps() {
const data = await fetchData();
return { props: { data } };
}
// Page is pre-built, served instantly
7. Geographic Optimization
Multi-region hosting:
- Deploy servers in multiple regions
- Route users to nearest server
Edge computing:
- Cloudflare Workers
- Vercel Edge Functions
- Run logic at edge, near users
Platform-Specific Tips
WordPress
- Use quality managed WordPress hosting
- Install caching plugin (WP Super Cache, W3 Total Cache)
- Use object cache (Redis)
- Minimize plugins (each adds processing)
- Use a CDN
Shopify
- Use Shopify’s built-in CDN
- Minimize apps (each adds load time)
- Optimize liquid templates
- Use lazy loading for below-fold
Custom Applications
- Implement application-level caching
- Use a CDN for static assets
- Database query optimization
- Consider static generation where possible
- Edge caching for dynamic content
TTFB Optimization Checklist
Hosting
- Adequate server resources for traffic
- Server located near users (or CDN)
- HTTP/2 or HTTP/3 enabled
- TLS 1.3 with OCSP stapling
Caching
- Full-page caching enabled
- Object caching for database results
- CDN caching for static assets
- Proper cache headers set
Database
- Indexes on frequently queried columns
- Slow queries identified and optimized
- Regular database maintenance
- Connection pooling (if applicable)
Application
- Unnecessary processing removed
- Static generation where possible
- Efficient code and queries
- Minimal third-party dependencies
Monitoring
- TTFB tracked over time
- Alerts for TTFB regressions
- Regular performance audits
Related Resources:
Tags:
Share this article:
Ready to improve your SEO?
Get a free SEO audit and see exactly what needs fixing on your site
Start Free Audit