What Is TTFB? Time to First Byte and How to Fix It

What Is TTFB? Time to First Byte and How to Fix It

Time to First Byte (TTFB) measures how quickly a browser can connect to your servers and how long the first stretch of downloading data from them takes. Tracking the TTFB on your site lets you follow how your server performance shifts over time.

TTFB sits inside Core Web Vitals and is a site performance measurement everyone should be watching. A weak TTFB shows your servers are not answering quickly enough, which means you can lose visitors during the page load. So the delay is not only irritating: it can send visitors bouncing straight off to one of your competitors.

In this guide we will try to tell you everything you need to know about the Time to First Byte metric, gathered under three headings: how it is measured, why it matters and how to improve it. With this in hand, get ready to build a fast experience for your visitors.

TTFB Measurement Tool

TTFB is not only about the server. So if you have made an improvement on your site, check again here and test whether it actually moved.

TTFB Test

See this value for your own site straight away: enter your address and your TTFB Test result, plus insights specific to this tool, will appear here.

Free, no sign-up needed; the analysis also personalizes every one of our tools for your site.

If you have updated a plugin or a theme on your site, test the TTFB here without fail. If you have added a new plugin, this is also where you can analyze its effect on TTFB.Celal Dinç, Software Engineer

What does TTFB measure?

TTFB measures the time between a visitor clicking a link or pressing enter on the keyboard and the first byte of that page arriving.

For most people this will (we hope) feel instant, but a great deal happens behind the curtain. The TTFB of a page is the sum of all the tasks below:

  • Redirect time: the time it takes for any URL redirect in place to resolve  (when a URL redirects with a 301, a 302 and so on).
  • Service worker start-up time : not relevant in every case.  Service worker APIs resemble a proxy server in that they run in the browser and can change requests before or after they come back from the server.
  • DNS lookup :  a DNS lookup turns the letters and dots we use for URLs such as turksem.com into an IP address your browser can use to download the right web page.
  • Connection and the TLS handshake : the time it takes the browser and the server to establish a connection so that data can travel.
  • The request : the browser asking the server for data and the server sending it back. Once the first byte is complete, we have a value to measure.

The TTFB of Google.com.tr

TTFB measurement for Google.com.tr

The TTFB of Google.com.tr: 0.5 seconds

It is worth remembering that when people reach your site, TTFB can vary a great deal depending on many factors. The further someone is from the server, the longer the data physically takes to reach them. Someone in New York and someone in Tokyo can therefore see completely different TTFB figures and have very different experiences of your pages.

Note: find out how many seconds your site takes to open in different countries.

Why should you improve TTFB?

TTFB is the backbone of page speed. A good TTFB may not guarantee a fast load, but a bad one is enough on its own to make the site feel slow, and people do not like slow sites. According to research by Google, even a single second added to the load raises bounce rates considerably. For your pages to stand a chance of impressing readers, your TTFB has to be as fast as you can make it.

A slow site does more than raise the number of bounces; it also affects where your site ranks on Google. Google has stated that the search engine treats page experience as a ranking factor. Sites are judged on good experience against a range of factors, and one of them is  Core Web Vitals, a set of performance measurements that rest partly on TTFB.

Note: we covered the subjects around page experience in detail in our what is Search Console article.

Largest Contentful Paint (LCP), for instance, is a Core Web Vital that measures how long the heaviest element at the top of your page takes to load. If your page takes a long time to download data from your server, which is to say your TTFB is slow, your LCP score will be worse. Google will read that as a negative page experience signal affecting your search rankings.

What counts as a good TTFB?

With TTFB, faster is always better. Most pages should be aiming for a TTFB under 800 ms. Go past 800 ms and you run the risk of load times that are noticeably slow.

Remember that every page on your site will have a different TTFB, and that these scores depend heavily on where the visitor is. So it matters that you test your pages regularly from different locations to catch the ones falling below the 800 ms benchmark (more on that shortly).

Which server settings or optimizations move TTFB the most?

Improving Time to First Byte (TTFB) usually involves server-side optimization as well. Settings such as enabling compression, making use of caching mechanisms, optimizing database performance and updating to the latest versions of your web server software all reduce TTFB considerably. Each of these strategies aims to minimize the time spent processing and transferring data between the server and the browser.

What are the real-world effects of TTFB on experience and SEO?

The effects of TTFB on experience, and so on SEO, are considerable. A stronger TTFB leads to faster page loading and a faster Largest Contentful Paint, which raises satisfaction, lowers bounce rates and can lift engagement and conversions.

Search engines favor faster websites, treating site speed as a ranking factor. Improving TTFB can contribute to greater visibility in search and to better rankings.

Four ways to improve TTFB

Doing these before your first byte loads will win you some milliseconds off your TTFB.

Here are a few ways to shave those milliseconds:

1. Upgrade your hosting or your servers

This step is the single most important thing you can do to get a visible improvement in your TTFB. Investing in better hosting or servers lets you speed up connection times and move data to browsers faster.

In some cases all you need to do is upgrade your servers. If memory or CPU limits are holding your performance back, an upgrade may be exactly what you need for better TTFB results.

In others, changing your hosting provider is the more suitable answer. But what makes one hosting provider better than another is not always obvious. While you weigh up different hosting options, look at whether they:

  • Having your own dedicated server can be an advantage.
  • Have CPU, memory and GPU specifications above the servers your competitors use.
  • Run their own servers close to where your site visitors are.

Show this to your server administrator: TTFB is largely about server figures. Site owners should write to you to get their TTFB improved, and if you trust your server, you should write to your data center management. Improving TTFB is the only way to be a good hosting provider.

2. Use a content delivery network (CDN)

CDNs improve TTFB because they let you keep your content cached on networks of servers spread around the world. With access to servers in many different places, you should be able to serve visitors faster (how physically close a visitor is to the server affects how long the data takes to reach the browser).

Learn: in our article on how the search engine optimization settings of your home page should look, we compared opening speeds by country.

CDNs also help you automatically in the following ways:

  • Cutting the number of requests your origin server has to deal with, which means less load.
  • Shrinking file sizes to make transfers faster.
  • Optimizing server settings for higher speeds.

A recommendation: one of the most widely used companies in this area is Cloudflare CDN. As an alternative we can also name Quic.cloud.

3. Cut your DNS lookup time

DNS lookups are an important part of the page loading process, since they turn the URLs people use into the IP addresses computers use. Servers have to run that check before sending the first byte of data back to the browser. Given that basic mechanism, optimizing the DNS lookup process helps you win time off your TTFB.

Some ways to cut your DNS lookup time:

  • Giving your DNS records long-lived TTL values, which lets DNS be cached for at least 24 hours.
  •  Using dns-prefetch to cut possible delays during the page load.
  • Removing every page redirect.
  • Caching commonly used assets such as font or CSS files.

4. Default to server-rendered HTML

Adjusting server or cache settings is far more involved than the other 3 options on this list. But to get the best TTFB results, your servers have to be optimized so they make your website data available in the shortest possible time.

Another way to get your servers responding faster is server-side rendering (SSR). SSR means pages are rendered on the server and then sent to the browser as a whole. With pages that update often, you can use SSR to build pages ahead of time, cache them for a set period and then send the page quickly when the browser asks.

We will share a Next.js performance guide with you before long, so you can see which path to take.

How can you test and track your TTFB scores?

The easiest way to test your TTFB is to use our free  Core Web Vitals checker.

Test it: https://pagespeed.web.dev/

Check in one click whether your site passes its Core Web Vitals assessment.

The core data here sits under “see what your real users are experiencing”. The system will not give you an instant TTFB figure.

The trouble with tools such as PageSpeed Insights and GTmetrix:

  • They do not take data from everyone (from browsers other than Chrome, and from people on iOS).
  • They do not let you schedule tests or track performance.
  • There is no data on smaller sites with less traffic.
  • They do not update daily (CrUX updates on 28 days of data).

Get help with the metrics that matter most

Getting help from a professional SEO specialist can save you a serious amount of time. Türk SEM provides consultancy in this area to a great many large companies.

OUR DNS TEST TOOL: if you cannot find the cause of your TTFB problem at all, has it crossed your mind that the trouble may be in your DNS response time? With the DNS Checker built by the Türk SEM developer team you can see your site's DNS response time measured from Istanbul. It is the only DNS checker based in Istanbul.

Published: Updated: Türk SEM Academy
Tahir Dinç

Author

Tahir Dinç

SEO Specialist · Founder of Türk SEM

I began this work in 1999 and became an ODP editor in 2004. Today I provide SEO and Google Ads services to a great many large companies. I also chair Türk SEM Group and run the companies within it.

View profile →

Related General Topics Articles