Time to First Byte — TTFB — is one of the most direct measures of server-side performance available through frontend monitoring. It measures the time from when a browser sends a request to when it receives the first byte of the response. A high TTFB is almost always a backend problem, which makes it a uniquely useful bridge between frontend and backend observability.
How TTFB Is Measured
TTFB includes DNS resolution time, TCP connection time, TLS handshake time, and server processing time. For dynamic applications, server processing time — the time your backend spends generating the response — is usually the dominant component. For static files served from a CDN, network latency dominates instead, and TTFB is typically very low.
What Causes a High TTFB?
- Slow database queries that block the response from being generated
- Heavy server-side computation that runs synchronously on the request path
- Cold-start latency in serverless or edge function deployments
- Unoptimised server-side rendering with expensive data fetching
- Geographic distance between the user and the server handling the request
What Is a Good TTFB?
Google's Web Vitals guidelines consider TTFB under 800ms 'good', between 800ms and 1,800ms 'needs improvement', and above 1,800ms 'poor'. For API endpoints specifically, targets should be significantly tighter — P95 TTFB under 200ms is a reasonable goal for most user-facing routes. Anything above 500ms at P95 for an API endpoint is worth investigating.
How to Reduce Your TTFB
- Add database query caching with Redis or Memcached for frequently-requested, slowly-changing data
- Use a CDN to serve cached responses from edge nodes close to your users
- Enable server-side rendering streaming so the browser can start parsing before the full response is ready
- Move long-running operations off the request path using background queues
- Consider multi-region deployment if a significant portion of users are geographically far from your servers
TTFB as a Backend Health Signal
Because TTFB captures server processing time so directly, it is one of the best frontend-measurable proxies for backend health. When TTFB trends upward, your API is slowing down — and your backend monitoring should tell you exactly which route or database query is responsible. The two data sources complement each other perfectly.
Statvisor tracks TTFB as part of its Core Web Vitals monitoring alongside LCP, CLS, FCP, and INP. When TTFB spikes, you can immediately cross-reference it against backend latency data in the same dashboard to pinpoint the cause.
Ready to monitor your API in production?
Statvisor gives you latency percentiles, error rates, and request volume for every route — in minutes, not days.
Get started free →