Xao Yang

Xao Yang

Time To First Byte

In my new role, I am doing full-stack development. However, as an engineer who identifies himself as a backend developer, there are front-end concepts that I am starting to familiarize myself with. One of those concepts is the time to first byte (TTFB).

What is TTFB?

TTFB is the time it takes for users' browsers to receive the first byte of page content.

When users navigate to a URL in their browser, the browser will make a network request to fetch content from the server. The server receives the request, processes it, and returns content.

The user's network latency and the time it takes for the server to return a response determines TTFB. However, TTFB should not be confused with how long it takes for a page to load.

Why do we care about TTFB?

TTFB is correlated with bounce rates. Bounce rate is a metric that is typically used as a measurement of a website's overall engagement. They capture the percentage of visits that are single-page sessions.

A 2-second delay in page speed can increase bounce rates by 100%.

What is a good TTFB?

Anything under 200ms is considered good.

300-500ms is considered average.

600+ms is considered bad.