Time to First Byte
Definition
Time to First Byte (TTFB) is the foundational latency metric measuring the duration from the moment the browser initiates an HTTP request until the first byte of response data is received from the web server.
Why It Matters
TTFB serves as the performance ceiling for all subsequent browser rendering milestones. A delayed server response pushes back HTML parsing, blocking CSS and JavaScript discovery, and directly inflates First Contentful Paint (FCP) and Largest Contentful Paint (LCP). Search engine crawlers also allocate crawl budget more efficiently to low-latency hosts.
Google Core Web Vitals TTFB Thresholds (75th Percentile)
| Criterion / State | Requirement / Target | Status |
|---|---|---|
| Good (Fast) | ≤ 800 ms | Optimal |
| Needs Improvement | 800 ms – 1,800 ms | Needs Work |
| Poor (Slow) | > 1,800 ms | Avoid / Fail |
Practical Implementation Example
Proper HTTP cache headers enable CDN edge nodes to serve responses in under 50 ms, while Server-Timing exposes internal database and computation delays to developers.
// Fast Next.js route handler utilizing edge caching headers
export async function GET() {
const data = await getCachedProducts();
return Response.json(data, {
headers: {
'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate=86400',
'Server-Timing': 'edge;dur=12, db;dur=34',
},
});
}How to Audit TTFB in ScanWise
ScanWise audits server latency across geographic edge regions, measuring DNS lookup, TCP handshake, TLS negotiation, and server execution duration down to the millisecond.
Audit your origin TTFB in ScanWiseCommon TTFB Mistakes & How to Fix Them
| Mistake | Why It Hurts | The Fix |
|---|---|---|
| Relying on single-region origin servers for global visitors. | Speed-of-light propagation latency adds 150-250 ms for transcontinental HTTP handshakes before compute starts. | Deploy edge middleware, global CDNs (Cloudflare, Fastly), or multi-region read replicas. |
| Uncached blocking database queries inside synchronous SSR page renders. | Every user request blocks waiting for unindexed SQL queries, driving TTFB above 1,500 ms. | Wrap expensive calls with React cache() or unstable_cache(), and stream non-critical UI with Suspense. |
Related Engineering Guides
How to Reduce TTFB in Next.js: Complete Server Optimization Guide
Benchmark database queries, configure CDN edge caches, and optimize cold starts to slash origin latency.
How to Improve Page Speed: A Step-by-Step Technical Guide
Systematic methodology to triage network, server, and client bottlenecks across desktop and mobile.
Core Web Vitals in Next.js: The 2026 Developer Guide
Architectural strategies to achieve sub-2.5s LCP, zero layout shifts, and responsive interaction in production.