Time To First Byte (TTFB) is a measurement of a server's responsiveness. It accounts for the amount of time that elapses when:
- A request is sent to your server
- The server processes that request
- 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:
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.
To use GTMetrix:
- Go to https://gtmetrix.com.
- Type in your domain name in the search bar.
- Wait for your results to propogate.
- Click on Waterfall.
- Hover your mouse over the colored bars associated to "/".
- The time associated to "Waiting" is your TTFB.
To use KeyCDN:
- Go to https://tools.keycdn.com/performance.
- Type your domain name in the search bar.
- Your TTFB results will propogate on the right-hand side.
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.
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.