Time To First Byte (TTFB)


  • Applies to: Grid
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Account Center access, WordPress Dashboard access
  • Applies to: DV
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Account Center access, WordPress Dashboard access
  • Applies to: Managed WordPress
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Account Center access, WordPress Dashboard access

Overview

Time To First Byte (TTFB) is a measurement of a server's responsiveness. It accounts for the amount of time that elapses when:

  1. A request is sent to your server
  2. The server processes that request
  3. The response is sent back to the client.

A common example is when a user types your domain name in their browser. A request is sent to the server, the server processes this request, and the website data is sent back to the user. The moment that first byte reaches the user is what we call TTFB. Many variables can affect TTFB, such as your physical distance from the server, firewalls, network speed, server speed, etc.

Does TTFB directly affect my website speed?

It's important to keep in mind that TTFB measures "responsiveness" and is not exactly the same as "speed." Even if you have a fast TTFB, if your website has sleeping data processes, outdated plugins/CMS, misconfigured settings, or unoptimized code, the site will still load slowly. Conversely, a site that is well optimized for performance can still load in a reasonable time, even if the TTFB isn't the fastest.

Therefore, TTFB should not be used as a sole measurement of your site's speed or performance. But it can play a small role in the overall time it takes for a site to load. And there are methods of testing and optimzing TTFB.

If you'd like information on improving site speed, feel free to review some of our articles below:

Testing TTFB

TTFB can be tested by visiting a third-party site, such as GTmetrix or KeyCDN.

TTFB is measured in ms (milliseconds). Generally speaking, < 100ms would be optimal for static content, and 200-500ms would be considered healthy for dynamic content. If you are on a shared-server, you may see a slightly higher TTFB.

When testing, it's important to remember that TTFB can fluctuate throughout the day. It can also be affected by the geographical distance you are running your diagnostic from. Therefore, you may want to run several tests, from different geographical areas, over a period of time to get an accurate average for your overall TTFB.

GTmetrix

To use GTMetrix:

  1. Go to https://gtmetrix.com.
  2. Type in your domain name in the search bar.
  3. Wait for your results to propogate.
  4. Click on Waterfall.
  5. Hover your mouse over the colored bars associated to "/".
  6. The time associated to "Waiting" is your TTFB.

gt-3.png

KeyCDN

To use KeyCDN:

  1. Go to https://tools.keycdn.com/performance.
  2. Type your domain name in the search bar.
  3. Your TTFB results will propogate on the right-hand side.

key-1.png

Optimizing TTFB

There are a multitide of options to improve TTFB. These can include: reducing database queries, MySQL configuration, PHP configuratiton, increasing RAM, etc. Below we have provided some of the more accessible methods of reducing your TTFB.

Update CMS, plugins, and themes

Updating the WordPress version, as well as the plugin/themes can help improve the efficiency of database queries and site code. This can ultimately improve both site speed and TTFB.

Caching

Utilizing a caching plugin is an easy way to optimize your TTFB. Cache Enabler and W3 Total Cache are a few popular free options.

Caching is a common method used to optimize TTFB. The Managed WordPress servers actually come with caching features built-in, saving you the time of installing and configuring your own caching.
 

CDN

As mentioned before, the distance from the server plays a role in TTFB. Therefore, utilizing a CDN can help deliver content more efficiently through its network of servers. Media Temple actually includes a CDN with the purchase of Security Pack. You may also look into free CDN options, such as CloudFlare.