What is time to first byte?
Time to first byte (TTFB) is a metric for determining the responsiveness of a web server. It measures the amount of time between creating a connection to the server and downloading the contents of a web page.
Connecting to a web server is a multi-step process where each step can potentially lead to delays. When a website is slow or unresponsive, being able to pinpoint the source of the slowdown is key to improving the user experience.
TTFB helps enterprises identify weak points in the connection process. By determining where delays occur, enterprises can tweak their services to perform faster and more reliably. Since a website’s speed can impact its web search rankings, TTFB has become crucial to optimizing performance and increasing visibility.
What affects time to first byte?
TTFB is impacted by three key actions:
1) Sending a request from a client machine to the server
2) Processing that request on the server and generating a response
3) Sending the response from the server to the client.
Let’s break down what each of these actions mean.
Action 1: Sending a request to the server
Measuring TTFB begins with the request. The time it takes for a server to receive a request can vary based on the time it takes to perform a DNS lookup, the speed of the user’s network, the distance to the server, and any interruptions in the connection. Enterprises have no control over the link between the user and the Internet, but any delays will still impact their TTFB.
Action 2: Processing and generating the response
Once a server receives a request, it has to generate a response. This involves starting processes, making database calls, running web scripts and communicating with other systems on the network. Common strategies used by enterprises to reduce TTFB include caching web pages, optimizing server-side code, and improving hardware resources.
Action 3: Sending the response back to the client
Once a server generates a response, it needs to transmit it back to the user. This step is dependent on both the enterprise’s connection speed and the user’s connection speed. The TTFB is determined the moment the client begins receiving the response, literally when the client receives the first byte. Transmitting a request and a response over a network can account for almost 40% of the TTFB.
What is considered a good TTFB Score?
TTFB directly relates to core metrics Google uses to gauge the performance score of a website. The most important of these metrics is First Contentful Paint (FCP), which gauges the time from a user landing on a webpage until the first full component (think image, button, words) on a page loads. The faster the site loads, the better the user experience and the higher Google ranks that page’s performance.
TTFB, is therefore directly linked to this metric. A “good” TTFB score is considered one where the 75th percentile of users experience FCP within the ‘good’ FCP threshold. This is a TTFB of 0.8 seconds or less.
0-800ms = good
801-1800 ms = needs improvement
1801 and greater = poor.
Benefits of optimizing time to first byte
Optimizing TTFB benefits both users and content providers.
Users see an improved browsing experience since they have to spend less time waiting for a web service to generate a response.
Enterprises see higher customer engagement and retention as users are less likely to leave due to delays or slow loading times.
How to Measure the Time to First Byte?
TTFB is measured by determining the time between the moment a user initiates a request on their browser, and the moment the browser receives the first byte of response from the server.
TTFB can be measured using a web performance tool. Examples include GTmetrix, WebPageTest, Google PageSpeed and CrUX.
How a CDN can improve TTFB
The time it takes to load a web page has an enormous impact on customer retention. When users abandon a website that takes mere seconds too long to load, having a low TTFB becomes essential. It not only reduces the chance of losing a customer, but ensures users have a fast and engaging online experience.
Moving to a CDN like Fastly can help to dramatically reduce your TTFB. You can learn more about it here.