TTFB can be broadly defined as the period of time from the moment the user sends the search request to the first ‘byte’ or bit of data to reach their computer. TTFB is ultimately composed of the following three components:
- The time it takes for the user request to arrive at the web server
- The time required for the web server to process the user’s request and generate the response
- The time for this response to return to the user’s computer
The first component is directly influenced by the latency of the request, which can be defined as the amount of time required to transmit one bit of data from one place to another. This is not to be confused with bandwidth, which broadly deals with the amount of data, which can be transmitted from one place to another at any one time. Therefore the latency of a high bandwidth versus a low bandwidth connection is often the same as they are completely different metrics. As we are dealing with physical locations, the latency is usually directly related to the physical distances the bits of data need to travel. Hence if the majority of your visitors are located in another continent this can lead to high latency. In this particular situation we recommend the use of content delivery networks (CDN) located in or close to the location of the majority of your sites’ visitors. There are many CDNs out there such as Akamai and Amazon Cloudfront just to name some of the more popular solutions out there.
The second component of TTFB deals with time taken by the server to process the user’s request. This can be improved by avoiding the use of shared hosting as the other sites you share with can bring down the overall speed of the server and hence your TTFB. Another type of site hosting solution to avoid is virtual or on-demand hosting systems as to save money these servers are deactivated temporarily during periods of time where there is no traffic to your site and the reactivation process can add at least 10 seconds to the TTFB or the first subsequent request.
The final component of TTFB involves the amount of time required for the request response to return to the user’s computer. Webmasters can influence this factor in a number of ways depending on the nature of their site and the type of content management system (CMS) they use, if any. Many CMS solutions have a “debugging mode” which must be switched off for the purposes of TTFB optimisation. Another feature webmasters should look for if the content on their site does not change frequently is utilising server side caching as this can store some of the elements on the user’s computer to expedite future request responses.
Webmasters must first know their sites’ starting point prior to pursuing any of the aforementioned TTFB optimisations. Luckily there is a great free tool for doing just that called Web Page Test. This tool tests all aspects of site speed therefore webmasters should only focus on the TTFB component of this test, which can be found in the green section of the results chart. The latency component of TTFB can be tested using the ‘ping’ command in the text-based command centre found in all operating systems. You should aim to reduce your ping result to less than 100 milliseconds for optimal TTFB results.
Google ultimately wants to offer its users a superior search experience therefore they place great importance on the speed of search results. This is why Google rewards sites with low TTFB with higher search rankings and conversely penalises sites with high TTFB with lower search rankings respectively. Hence this is precisely why webmasters should make TTFB optimisation a priority.