Web Performance — CDN Architecture

CDN Time to First Byte Optimization: Sub-100ms TTFB at Global Scale

James Thornton, CDN Solutions Architect September 1, 2026 9 min read

Time to First Byte (TTFB) is the most unforgiving web performance metric. It measures the entire network path before a single byte of content arrives — and it dictates everything that follows. If you can consistently deliver sub-100ms TTFB from edge PoPs worldwide, you win Core Web Vitals, SEO, and user experience. Here is how to engineer it.

KEY INSIGHT  TTFB is not a server metric. It is a network metric. 80% of TTFB variance comes from DNS, TCP/TLS handshakes, and distance to the serving node — not origin processing time. Optimize the path, not just the server.

What Sub-100ms TTFB Actually Means

TTFB is defined as the duration from the browser's navigation start to receiving the first byte of the response. Per the Navigation Timing API, it includes DNS lookup, TCP handshake, TLS negotiation, request send, and server response time. Google's Core Web Vitals guidance treats TTFB as the foundation for Largest Contentful Paint (LCP) — a slow TTFB guarantees a slow LCP.

For a global audience, sub-100ms TTFB does not mean 100ms from your origin in Virginia. It means 100ms from the edge node closest to the user in São Paulo, Singapore, or Berlin. Without a CDN, physics makes this impossible: light in fiber travels ~200km per millisecond round-trip. A 9,000km origin distance already costs 90ms in propagation alone, before any handshake.

We categorize TTFB into three tiers:

If your p75 TTFB for cached assets exceeds 120ms in any major region, you have an architecture problem, not a tuning problem.

Anatomy of TTFB: Where Milliseconds Go

Every TTFB can be decomposed into sequential phases. Understanding this waterfall is critical because each phase has a different optimization lever.

Performance Comparison: Edge vs Origin Processing
Metric Edge Processing Origin Processing Improvement
Latency (p50)8–15 ms120–300 ms15–20x faster
Cache Hit Ratio85–95%N/AReduces origin load
TLS Handshake1–5 ms (nearby PoP)50–150 ms10–30x faster
Bandwidth Cost$0.01–0.04/GB$0.05–0.12/GB3–5x cheaper
Availability99.99% (multi-PoP)99.9% (single DC)10x fewer outages
TTFB Waterfall Breakdown from Navigation to First Byte TTFB WATERFALL — BUDGET FOR 100MS TARGET DNS 10ms TCP 25ms TLS 1.3 25ms Request 5ms Server/Edge 35ms Anycast + Pre-resolve Reuse / 0-RTT Session Resume HTTP/3 QUIC Cache HIT = 5ms WITHOUT CDN: 380–650ms DNS (40ms) + TCP (80ms) + TLS (90ms) + Origin RTT (150ms) + Origin Processing (80ms) WITH OPTIMIZED CDN: 45–85ms Anycast DNS (8ms) + Reused QUIC (0ms) + Edge HIT (20ms) + Early Hints SAVINGS: ~300ms PER NAVIGATION
Figure 1: TTFB phase breakdown. Optimized CDN path eliminates 2–3 round trips via connection reuse and edge termination.

The largest wins are not from faster origin code, but from eliminating round trips. A standard HTTPS connection requires 3 RTTs before the request is even sent: DNS → TCP SYN/ACK → TLS handshake. At 40ms RTT, that is 120ms overhead. A CDN with Anycast, TLS 1.3, and QUIC can reduce this to 0–1 RTT for returning visitors.

1. Edge Architecture: Anycast and PoP Density

Your CDN is only as fast as its closest Point of Presence. Two architectural decisions dominate TTFB: routing and density.

Anycast vs. DNS-based routing: Traditional DNS-based CDNs return an edge IP based on the resolver's location, not the user's. Anycast advertises the same IP from every PoP and relies on BGP to route the user to the topologically nearest node. This cuts 15–40ms of DNS latency and avoids misrouting from centralized resolvers like 8.8.8.8. For sub-100ms TTFB, Anycast is non-negotiable.

PoP density and peering: Measure TTFB by ASN, not just by country. A PoP in Frankfurt does not guarantee low TTFB in rural Poland if the last-mile ISP peers poorly. Leading CDNs maintain 300+ PoPs with direct peering at IXPs and inside eyeball networks. Validate with real-user monitoring segmented by network. Our monitoring and observability guide details how to instrument TTFB by PoP, cache status, and ASN.

Also enable DNS prefetch and preconnect hints, and ensure your authoritative DNS has a low TTL with DNSSEC without adding latency. Use a managed DNS with <15ms global resolution time.

2. Eliminate Handshakes: TLS 1.3, Session Resumption, and HTTP/3

Handshake optimization is the highest-ROI TTFB lever for dynamic content where caching cannot help.

TLS 1.3 and 0-RTT

TLS 1.3 reduces the handshake from 2-RTT to 1-RTT, and with session resumption via PSK, to 0-RTT for repeat connections. Combined with TCP Fast Open, you can send the HTTP request with the initial ClientHello. This alone saves 60–90ms on high-latency links. Enforce TLS 1.3 at the edge and enable 0-RTT with anti-replay protection for safe GET requests.

QUIC and HTTP/3

QUIC merges transport and cryptography, eliminating TCP head-of-line blocking and enabling connection migration. For mobile users switching from Wi-Fi to 5G, QUIC preserves the connection instead of re-handshaking. As detailed in our HTTP/2 vs HTTP/3 analysis, QUIC's 0-RTT and improved loss recovery consistently deliver 20–30% lower p95 TTFB than HTTP/2 over TCP.

Enable HTTP/3 at the edge, advertise via Alt-Svc, and ensure your origin supports QUIC to the shield. Keep TCP+TLS as fallback, but prioritize QUIC.

# Verify TTFB and handshake efficiency from edge
curl -w "dns:%{time_namelookup} tcp:%{time_connect} tls:%{time_appconnect} ttfb:%{time_starttransfer}\n" -o /dev/null -s https://www.example.com/

# Expected for optimized edge HIT:
# dns:0.008 tcp:0.018 tls:0.032 ttfb:0.045

# Check HTTP/3 and 0-RTT support
curl --http3 -I https://www.example.com -v 2>&1 | grep -E "Alt-Svc|QUIC|TLS 1.3"
alt-svc: h3=":443"; ma=86400, h3-29=":443"

Other critical edge optimizations: OCSP stapling (saves 50–150ms on first connection), strict keep-alive (120s+), connection coalescing for HTTP/2/3, and 103 Early Hints to start preloading before origin response.

3. Caching Strategy: The Only Way to Guarantee Sub-100ms

No amount of routing can beat serving from memory at the edge. Your cache hit ratio (CHR) directly predicts your TTFB distribution.

TTFB Component Budget (HIT) Budget (MISS) Optimization Levers
DNS Lookup 5–12 ms 5–12 ms Anycast DNS, 300s TTL, prefetch
TCP + TLS Handshake 0–15 ms* 0–15 ms* TLS 1.3, QUIC 0-RTT, session resumption
Edge Processing 3–8 ms 5–12 ms Workers off hot path, VCL optimization
Cache Fetch 2–10 ms 25–60 ms (parent) Tiered cache, RAM cache, SSD NVMe
Origin Fetch — 40–120 ms Shield PoP, Argo routing, keep-alive
Total TTFB 15–55 ms 80–190 ms Target: >90% HIT, <5% origin

* 0ms for reused QUIC/TLS session, 15ms for new TLS 1.3 handshake on nearby PoP.

To push CHR above 92%:

# Optimal edge cache headers for HTML
Cache-Control: public, s-maxage=60, stale-while-revalidate=300, stale-if-error=86400
CDN-Cache-Control: max-age=60
Surrogate-Key: page-home html
Vary: Accept-Encoding

# Purge via surrogate key on deploy — instant global invalidation
curl -X POST https://api.cdn.example/purge -H "Authorization: Bearer $TOKEN" -d '{"surrogate_keys":["page-home"]}'

For image-heavy sites, pair this with image optimization at the edge — converting to AVIF/WebP and resizing at the PoP avoids origin fetches for derivatives entirely.

4. Tiered Caching and Origin Shield

Without tiered caching, a cache MISS from 50 edge PoPs results in 50 origin hits (thundering herd). With tiered caching, those 50 misses collapse to 1 origin hit via a regional shield PoP.

Configure a two-tier hierarchy: global edge (300+ PoPs) → regional parent (e.g., Ashburn, Frankfurt, Singapore) → shield → origin. The parent is chosen for proximity to origin and dense interconnect. This reduces MISS TTFB by 60% and origin load by 85–95%.

Complement this with origin keep-alive and connection pooling. Maintain warm, reused HTTP/2 or HTTP/3 connections from shield to origin with 60–90s idle timeout. Cold origin TCP+TLS adds 80–150ms per MISS. Also enable Argo / dynamic acceleration for uncacheable routes: smart routing over private backbone avoids congested public internet, cutting dynamic TTFB by 25–40%.

Finally, protect TTFB under attack. A DDoS flood that saturates origin will spike TTFB to seconds. Always front origin with DDoS protection and rate limiting at the edge so malicious traffic never reaches the shield.

5. Measure What Matters: RUM and Synthetic

You cannot optimize what you do not measure by cache status and geography.

// Capture TTFB with cache status in RUM
const nav = performance.getEntriesByType("navigation")[0];
const ttfb = nav.responseStart - nav.requestStart;
fetch("/analytics/ttfb", {
  method: "POST",
  body: JSON.stringify({
    ttfb: Math.round(ttfb),
    cache: response.headers.get("x-cache"), // HIT, MISS, BYPASS
    colo: response.headers.get("cf-ray")?.slice(-3),
    h3: navigator.connection?.effectiveType
  })
});

Expose Server-Timing headers from edge to debug: Server-Timing: edge;dur=4, parent;dur=22, origin;dur=48 lets you pinpoint whether TTFB is edge, parent, or origin bound.

Consistent sub-100ms TTFB is not a single trick — it is the compound effect of Anycast routing, 0-RTT handshakes, QUIC, aggressive but correct caching, tiered shielding, and relentless measurement. Start with handshake elimination and cache hit ratio; those two alone typically move global p75 TTFB from 280ms to under 90ms.

Frequently Asked Questions

What is a good TTFB for a CDN-accelerated site?

For edge-cached content, aim for sub-100ms globally and sub-50ms in major markets. For dynamic, uncacheable content via CDN acceleration, 100–200ms is excellent. Anything consistently above 300ms indicates DNS, TLS, or origin latency issues that need architectural fixes.

Does HTTP/3 actually improve TTFB over HTTP/2?

Yes, especially on lossy or mobile networks. QUIC eliminates TCP head-of-line blocking and combines TLS 1.3 handshake with transport, cutting 1–2 round trips. Real-world tests show 15–35% lower TTFB on high-latency links compared to HTTP/2 over TCP+TLS, with even larger gains on packet loss.

Why is my CDN TTFB still high even with cache HIT?

A HIT should be 20–60ms. High HIT TTFB usually means poor PoP coverage, no Anycast routing, overloaded edge compute, missing TLS session resumption, or lack of connection coalescing. Check edge Worker overhead, ensure OCSP stapling and keep-alive are enabled, and verify users are hitting the nearest PoP via Anycast.

How does tiered caching reduce TTFB?

Tiered caching creates regional parent caches between edge PoPs and origin. On a cache MISS at the edge, the request hits the parent instead of origin, reducing round-trip distance by 60–80% and shielding origin from thundering herds. This cuts MISS TTFB from 400–700ms to 90–140ms while reducing origin load dramatically.

References & Standards: OWASP CDN Security · RFC 7234