Karolina Szczur
May 31, 2023
Illustrated by
Time to First Byte (TTFB) is a metric that reflects how quickly a browser can connect and download data from your servers. By tracking TTFB timings across your site, you can detect any slowdowns or issues with your servers that negatively affect your performance.
TTFB may not be a Core Web Vital, but it’s still a crucial site performance metric that everyone should track. Poor TTFB indicates that your servers aren’t responding quickly enough, which can cause cascading performance issues for the entire page-loading process. That time isn’t just annoying—it could directly lead to visitors bouncing and checking out a competitor.
This guide will give you everything you need to know about the Time to First Byte metric: how it’s measured, why it’s important, and how to improve it. With this knowledge, you’ll be ready to create a snappy site experience for your visitors.
TTFB measures the amount of time between when a visitor clicks a link or hits enter on their keyboard and when that page’s first byte is downloaded.
For most people, this process will (hopefully) feel instantaneous, but several things are happening behind the scenes. A page’s TTFB is the sum of all of the following tasks:
It’s important to note that TTFB can differ greatly based on many factors when people access your site. The further a person is from the server, the longer it takes for data to physically make it to them. For this reason, a person in Sydney and London can get radically different TTFB times and have very different experiences on your pages.
TTFB is the backbone of page speed. Good TTFBs may not ensure a quick load time, but bad ones are enough to make a site feel slow—and people don’t like slow sites. According to a study by Google, even a single added second can increase bounce rates dramatically. To give your pages a chance at impressing readers, your TTFB needs to be as quick as possible.
A slow site doesn’t just increase bounces—it also influences your site rankings on Google. Google has stated that its search engine considers page experience a ranking factor. Sites are judged for good experience based on several factors, one of which is the Core Web Vitals—a set of performance metrics that partially rely on TTFB.
For instance, Largest Contentful Paint (LCP) is a Core Web Vital that measures how long it takes to load the most data-intensive element on the above-the-fold portion of your page. If your page takes a long time to download data from your server (i.e., your TTFB is slow), your LCP score will be worse. Google will take that as a negative page experience signal, affecting your search rankings.
Faster is always better when it comes to TTFB. Most pages should aim for TTFBs that are less than 800 ms. Any longer than 800 ms, you’ll risk having noticeably slow load times.
Remember that every page on your site will have different TTFBs and that these scores depend heavily on visitor location. For this reason, it’s important to regularly test your site’s pages using different locations to catch any pages that fall below the 800 ms benchmark (more on that later).
Improving Time to First Byte (TTFB) often involves server-side optimizations. Configurations such as enabling compression, leveraging caching mechanisms, optimizing database performance, and updating to the latest versions of web server software can significantly reduce TTFB. Each of these strategies aims to minimize the data processing and transfer times between the server and the client.
The real-world impacts of TTFB on user experience and SEO are significant. A lower TTFB leads to faster page loads, faster Largest Contentful Paint, enhancing user satisfaction, reducing bounce rates, and potentially increasing engagement and conversions.
For SEO, search engines favor faster websites, considering site speed as a ranking factor. Improving TTFB can thus contribute to better search engine visibility and higher rankings.
To lower your TTFB, you’ll need to shave valuable milliseconds off one or more of the processes before your first byte loads. Here are a couple of ways you can do that.
This step is the most important thing you can do to make a noticeable improvement in your TTFB. By investing in better hosting or servers, you’ll be able to speed up connection times and get data over to browsers more quickly.
In some cases, all you’ll need to do is upgrade your servers. If your performance is constrained by memory or CPU limitations, an upgrade could be precisely what you need for better TTFB outcomes.
In other cases, changing your hosting provider might be a more appropriate fix. However, it’s not always clear what makes one hosting provider better. When evaluating different hosting options, you should consider whether they:
CDNs improve TTFB because they allow you to keep your content cached on their globally distributed network of servers. With access to more servers, you should be able to serve visitors more quickly (a visitor’s physical proximity to a server impacts how long it takes for data to get to their browser).
CDNs also help you by automatically:
DNS lookups are an essential part of the page-loading process as they translate the URLs people use into the IP addresses used by computers. Before servers can send back the first byte of data to a browser, they need to do this check. For this reason, optimising the DNS lookup process helps you shave time off your TTFB.
Some ways to reduce your DNS lookup time include:
Adjusting server or cache settings is far more complicated than other options on this list. However, for best TTFB results, your servers need to be optimised to get your data out the door as quickly as possible.
One way to make your servers react more quickly is to use Server Side Rendering (SSR). SSR means that pages are rendered on the server and then sent whole over to the browser. With frequently updated pages, you can leverage SSR to render pages in advance, cache them for a set amount of time, and then quickly send over the page when the browser requests it.
Learn more about Next.js rendering modes in our guide to Next.js Performance.
The easiest way to test your TTFB is with our free Core Web Vitals Test:
Like Google’s PageSpeed Insights, our tool relies on CrUX data, which Google collects from Chrome browsers on non-iOS devices. The CrUX database consists of a large subset of people, allowing for reasonably accurate one-off checks. However, it’s not an ideal long-term solution.
The problem with tools like PageSpeed Insights or even our Core Web Vitals Test is that they:
A better solution is to use the Calibre platform to test and track performance metrics like TTFB.
Calibre saves you time and effort because you don’t need to run a test manually on every page and then plot your data to see ongoing trends. Instead, Calibre allows you to schedule automatic routine tests on all your pages to quickly spot problems and see how your efforts result in better site performance.
Plus, you can customise each test to mimic different locations, internet connections, and device types to ensure that your site performs for all visitors. This helps ensure that your site performs well under all conditions, not just ideal ones. Check your site performance with our free 15-day trial.
If you’re looking for help with your site’s TTFB, chances are you’re also interested in improving your site’s most important performance metrics. Use our guides below to see how you can create noticeable performance gains for your site across all of the Web Vitals:
We will send you articles, tools, case studies and more, so you can become a better performance advocate.
Harry Roberts
Consultant Web Performance Engineer