Skip to main content
短.be

TTFB

The time from when a browser sends a request to when it receives the first byte of the response. A fundamental metric for server responsiveness.

Dec 19, 2025 · About 1 min read

Redirect

TTFB (Time to First Byte) measures the elapsed time from the moment a browser sends an HTTP request to the moment it receives the very first byte of the server's response. It is the most fundamental indicator of server responsiveness and the starting point for all web performance analysis.

TTFB is the sum of three components: request transmission time (network transit from browser to server), server processing time (handling the request, running database queries, generating the response), and response initiation time (the first byte traveling from server back to browser).

Google classifies TTFB as a supplementary Core Web Vitals metric. A good TTFB is 800 ms or less; anything above 1800 ms needs improvement. For shortened URL redirects, where the server simply looks up a mapping and returns a 301/302, the target should be under 50 ms.

Optimization techniques for a URL shortening service include CDN deployment (serving responses from edge locations close to the user), in-memory caching with Redis (caching URL mappings for sub-millisecond lookups), database index tuning, and enabling HTTP/2 for connection multiplexing.

Measurement tools include Chrome DevTools' Network tab (the "Waiting (TTFB)" column), Lighthouse performance audits, curl (curl -w '%{time_starttransfer}' URL), and WebPageTest. Separating server processing time from network transit time pinpoints the actual bottleneck. You can find related books on Amazon.

Share on XHatena

Was this article helpful?

Related Terms

Related Articles

FAQ

What is the difference between TTFB and LCP?
TTFB measures the time until the server starts responding. LCP (Largest Contentful Paint) measures the time until the largest visible content element is rendered. TTFB is a component of LCP - a slow TTFB inevitably leads to a slow LCP.
What is a good TTFB target?
Google considers 800 ms or less to be good for general web pages. For shortened URL redirects, aim for under 50 ms. With CDN and caching, 10-30 ms is achievable.
What causes a slow TTFB?
Common causes include insufficient server capacity, slow database queries, physical distance between server and user, and SSL/TLS handshake overhead. Deploying a CDN and optimizing caching are the most impactful improvements.

Ready to create a short URL?

Shorten a URL for Free