Skip to content
Core Web Vitals & SpeedTTFB

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 / StateRequirement / TargetStatus
Good (Fast)≤ 800 msOptimal
Needs Improvement800 ms – 1,800 msNeeds Work
Poor (Slow)> 1,800 msAvoid / 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.

src/app/api/products/route.ts
// 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',
    },
  });
}
Automated Verification

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 ScanWise

Common TTFB Mistakes & How to Fix Them

Common TTFB Mistakes & How to Fix Them
MistakeWhy It HurtsThe 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.