2. Four Origin Latency & Cache-Bypass Guardrails (Next.js App Router / Vercel Serverless SSR)
Primary Failure Mode: Serverless function cold-starts, uncached RSC data fetches, and synchronous third-party CRM/Auth calls delaying Time-to-First-Byte.
- 1. Cache-Busting Origin Probe (/contact?_cb=timestamp): Appends a unique cache-bypass query token and Cache-Control: no-cache header so probes measure true origin compute & database TTFB rather than a 30ms CDN edge hit.
- 2. Phase-Split Timing Decomposition (DNS / TCP / TLS / TTFB): Separates DNS resolution, TCP connect, TLS 1.3 handshake, and server processing time to pinpoint whether latency comes from network routing or origin bottlenecks (Serverless function cold-starts, uncached RSC data fetches, and synchronous third-party CRM/Auth calls delaying Time-to-First-Byte.).
- 3. Soft-Degradation Warning Before HTTP 502/524 Outages: Triggers an early engineering alert when uncached TTFB exceeds 550ms for 3 consecutive checks—catching stuck worker pools before Cloudflare throws Error 524.
- 4. Multi-Region Verification (US-East, EU-Central, US-West): Confirm latency regressions from 2+ independent regions before paging on-call engineers to eliminate transient single-ISP packet loss false alarms.
apexclimate.com)
# Measure True Uncached Origin TTFB & Phase Timings for apexclimate.com (Next.js App Router / Vercel Serverless SSR)
curl -sS -o /dev/null \
-H "Cache-Control: no-cache, no-store" \
-H "Pragma: no-cache" \
-H "User-Agent: OnBits-Latency-Canary/1.0" \
-w "http_code: %{http_code}\ncf_cache: %header{cf-cache-status}\ndns_ms: %{time_namelookup}s\ntcp_ms: %{time_connect}s\ntls_ms: %{time_appconnect}s\nttfb_s: %{time_starttransfer}s\ntotal_s: %{time_total}s\n" \
"https://apexclimate.com/contact?_cb=$(date +%s)"