Time to First Byte (TTFB)
You'll learn how TTFB measures the responsiveness of your server and network, marking the very beginning of your page load performance story.
What is TTFB?
Time to First Byte (TTFB) measures the duration from when a user's browser initiates a request (like clicking a link or typing a URL) to when the browser receives the very first byte of data from the server. It's essentially a timer that captures how quickly your server responds.
Think of it like ordering food at a drive-through: TTFB is the time from placing your order to when the server hands you the first item through the window—not when you receive everything, just that initial response.
What TTFB Includes
TTFB encompasses three critical phases:
- DNS lookup time – Translating the domain name to an IP address
- Connection time – Establishing the TCP/SSL connection
- Server processing time – The server generating and starting to send the response
Why TTFB Matters
While TTFB doesn't directly measure what users see, it's the foundation for everything else. A slow TTFB delays when the browser can start downloading HTML, parsing content, and rendering anything visible. It's particularly important for server-rendered pages where the initial HTML must be generated before sending.
Good TTFB thresholds:
- Good: < 800ms
- Needs improvement: 800ms - 1800ms
- Poor: > 1800ms
Common TTFB Improvements
- Use a CDN to reduce network distance
- Optimize database queries and server-side logic
- Implement caching strategies
- Upgrade hosting infrastructure
- Use HTTP/2 or HTTP/3
Key Takeaway: TTFB measures how quickly your server starts responding—it's the first domino that must fall before any other performance metric can begin improving.