Skip to main content
Improving time to first byte for marketers - be fast like these wildebeest

Web

Improving Time to First Byte for Marketers

Image of the author Tim Bowerbank

Tim Bowerbank - 15 Jul, 2024

Director

tags icons

website performance,

icon for email icon facebook share icon for linkedin

This article is going to focus on 'time to first byte', or TTFB for short. It's the ninth article of 10 aimed at marketers looking to better understand website speed. I'm an ex-marketer turned developer supporting businesses with fast websites.

If you're looking for advice and guidance on website speed then read on. And also check out our other articles that cover everything you need to know that will affect web page loading speed. From HTML through to fast fonts.

And remember, why are we bothered about fast web pages? Because it keeps visitors on our sites. Plus Google gives us an SEO boost.

 

What is Time to First Byte (TTFB)?

It's a speed measurement in milliseconds. The measurement starts when you navigate to a new web page. And stops when the very first byte arrives in your browser. So, in essence, how long it takes for a server to respond with the first byte of a website.

What's a byte? Computer-speak for a unit of data.

So, from the time you hit return after typing in a web address or clicking on a link... the following happens:

  • Your request travels through your local network and out into the wider-world!
  • DNS (the Domain Name System) kicks in and routes your request to the server (i.e. computer) holding the website you're requesting.
  • The server starts processing that request
  • The server finishes processing the request and returns HTML back to your browser
  • The HTML travels back through the wider outside networks and back through your local network
  • Bang... the first byte arrives in your browser.

 

Why is TTFB important? What is a good TTFB?

A slow TTFB is going to slow down the whole process of a web page loading. In PageSpeed Insights tests it will generate a: Reduce initial server response time

In a nutshell, you want a fast TTFB, something around 200 milliseconds or less (< 0.2 seconds). Our Pendigital site scores around 54ms but I often see web pages with speeds greater than 1000ms. That's not good! That's a whole second before even a byte of the site loads. If you have lots of other website speed issues then you can imagine how they all compound to create slow loading pages.

 

How fast is my TTFB?

To work out whether your site has a good TTFB then you're going to need a tool to measure it. In fact, I recommend two tools for helping calculate your TTFB.

The first one is a Chrome Extension: TTFB Checker. Install it and then pin it to your Chrome browser. Load a new page and check out the score. The only issue that I have with this tool is that if your Internet connection is slow then it will impact the score.

Try it on one of your main landing pages. Here's a screenshot of Pendigital's score.

image of time to first byte checker

If your pages are hitting the red zone, then you have TTFB issues.

The second tool is the KeyCDN Performance Test Tool. This eliminates the issue of a slow internet connection, or any issues with your local network.

Type in the web page that you want to check, hit return and voila! The test provides you TTFB scores from different locations around the world. If you have an international audience then this is superb!

keycdn report for pendigital.co.uk

But the TTFB chrome extension is still useful for a quick flagging up of issues if you know your internet connection is good.

 

What effects TTFB?

Assuming you have a good internet connection then the following are factors that contribute to good or bad TTFB scores.

 

Speed of DNS Routing

The Domain Name System directs your url requests to the computer that stores your website (the server). It's like the phonebook of the internet. Your request for a web page is whizzing through different hardware and software - you can read more about it here. Slow DNS routing will lead to higher TTFB scores.

 

Redirects

Redirects are all about sending a request for 'page A' to another 'page B'.

For example, your SEO expert may have asked you to include a keyword in your URL for a landing page. You need to tell your server to take the old URL (which people may be linking to) and any inbound requests for it must be sent to the new URL.

The issue with this, from a speed perspective, is that you're asking the server to do more work.

 

Physical distance

I was on a call to a customer in Seattle the other day. We were speaking over Zoom. I was amazed that there was hardly any lag time. Yet, even though Internet speeds are faster than ever before. It still takes longer for a byte of data to travel from London to Sydney than from London to Paris. And this is simply because there's greater distance to travel.

You'll see this when checking out the KeyCDN Performance Test Tool.

If your host asks you which data centre you want your website stored in then this is the reason. Choose one close to your customers. Have a global audience, then you need to be fast everywhere... we'll discuss global content delivery networks in a minute.

 

Quality of server

The faster the computer your website sits on (the server) the faster it will respond with that first byte. The faster the server can process all the jobs it has to do then the faster the first byte is returned.

So CPU, memory and SSD vs HDD does matter! This is even more important for systems like WordPress which need more processing power. We'll talk about that in a moment.

 

Server tasks

What are you asking your server to do? Is it simply returning an HTML page that already exists. Or are you asking it to dynamically build a web page and return that.

The latter is what happens with WordPress. Typically, the core steps involved with retrieving a WordPress (or Joomla, or Drupal, or similar) web page is as follows:

  • Server receives URL request
  • Server starts up WordPress
  • WordPress needs to: a) make calls to its MySQL database, b) Run plugins (which will also be making calls to the database and c) Merge returned data with different layouts.
  • When the page is ready WordPress returns it

All these jobs take time and are slowing down that TTFB.

Caching can help. We'll discuss this in a minute. But of course, only helps if you have it running.

 

Improving TTFB

Now that we know the principle causes of a slow TTFB we can set about resolving them.

 

Quality Hosting

You definitely get what you pay for. If your website is WordPress powered and you put it on budget hosting... then expect a poor TTFB. There's a reason the hosting business can afford to price it so low, they haven't forked out for the expensive servers.

I would recommend you use the KeyCDN Performance Test on the hosting company's website before purchasing. Remember, you're looking for a 200ms or less TTFB score.

 

Reduce your redirects

Reduce the work that your server has to do by reducing the redirects you've instructed it to do. Check with your SEO specialist first though!

 

Reduce the processing required for WordPress, Joomla, Drupal

Since there are so many WordPress (et al) websites out there, here's some specific advice for you:

  • Reduce the number of plugins: Does your website need all the plugins it's using? Plugins add extra time when constructing a WordPress web page. Investigate the impact that they might be having. Be careful turning plugins off, your website might depend on them!
  • Choose a fast theme: Run your KeyCDN Performance Test on any theme demo theme sites. So you get a picture of how well the theme performs. Bloated themes can slow down the dynamic creation of html pages thereby increasing the TTFB.
  • Implement a server cache: This is where the server saves dynamically created pages so that they can be re-used. They're a great idea for WordPress sites since the steps for dynamically creating pages are skipped and the html simply returned. The only issues are: that they introduce a more technical aspect to your site, can contain out-of-date content depending on when the cache was created. And beware, caches can also be cleared (i.e. emptied)... in which case the advantage of having pre-made html is lost.

 

Consider the JAM Stack

The last few years have seen developers move away from WordPress type sites. (BTW, the next and final article will be all about this). Many devs have moved to the JAM Stack. An approach that offers:

  • Increased performance
  • Higher security
  • Easier scaling (around the world)
  • ... and can be setup to be lightening fast.

I am a big fan of static site generators that fall into this category.

 

Move your content closer to your users

Since physical distance can contribute to increased TTFB. Then ensure your content is close to your users. If you're selling your products and services in the UK, then make sure your website is hosted in the UK. Many hosting companies these days ask you which of their data centres you'd prefer your website hosted at.

If you're exporting around the world... then it's wise to consider a global content delivery network (CDN). A global CDN is a "geographically distributed group of servers that caches content close to end users".

Our Pendigital.co.uk website is on the CloudFlare content delivery network. It's as fast in the UK as it is in Australia. It's also built using a static site generator.

 

And... hero blog animal image... it's a wildebeest with a top speed of 80kph! Wow... make sure your web pages load with the spirit of the wildebeest!

I think that's all for now. If you need help with speeding up your website then just shout. We're here to help! If you've found this article on TTFB interesting then don't forget to follow us: LinkedIn, Twitter and Facebook.

The tenth article of 10 for marketers is going to be all about the JamStack... a relatively new way of doing things. Look forward to seeing you there!

Share this article

icon for email icon facebook share icon for linkedin

Related Blog Articles

You might like these other web articles

Grab a coffee and have a read!

Image of guiding lighthouse

Helping you navigate the complex world of web and apps

Helpful guidance, profitable solutions

Get started on a project with Pendigital