How to Reduce TTFB (Time to First Byte) — Server Speed Guide
Cut your TTFB below 200ms with CDN configuration, caching strategies, server optimization, and edge computing. The foundation of all Web Vitals performance.
What is TTFB?
Time to First Byte (TTFB) is how long it takes from the browser's request to receiving the first byte of the response. While not a Core Web Vital itself, TTFB directly affects LCP and FCP. Target: under 200ms.
Every 100ms of TTFB improvement cascades into faster LCP.
Use a CDN for Edge Delivery
Serving your pages from a CDN edge location close to the user can cut TTFB by 100-500ms:
- Vercel — automatic edge deployment for Next.js
- Cloudflare Pages — global CDN with Workers
- AWS CloudFront — enterprise-grade CDN
For API routes, use edge runtimes:
Implement Aggressive Caching
Use stale-while-revalidate for dynamic content:
This serves cached content instantly and revalidates in the background.
Optimize Database Queries
Slow database queries are the #1 cause of high TTFB for dynamic pages:
Test these fixes on your site
Run a free audit to see your current TTFB score and get prioritized fix recommendations.
Run Free Audit