What Is Time To First Byte?
The time to first byte (TTFB) is a metric used to measure the responsiveness of an internet server. In brief, it measures the amount of time between the user starting the connection and the server responding so the client can download the contents of the requested web page.
Connecting to a web page is a multi-step process at which every additional step can cause a delay. When a website is slow or unresponsive having the ability to locate the source of the slowdown is vital to improving the overall experience for the end-user. You can use tools such as https://tools.pingdom.com/ which allow you to see a “Waterfall” chart and this shows all of the processes and individual elements which need to be sent for and requested by the site.
The time to first byte helps websites identify weak points and choke points in their system within their connection process. By working out where the delays and time is lost a website can tweak and adjust their services to allow the website to load faster, reliably and more efficiently. The load time of a website is a high ranking factor in Googles search rankings. This means that time to first byte is a key factor when looking at optimising both performance and increasing visibility in the search rankings.
What Affects Time To First Byte?
1. The initial request from the client's machine to the server on which the website is hosted.
Measuring the time to first byte. begins with the request to the server. The time that it takes the server to respond to this request and perform the DNS lookup can vary depending on the speed of the user’s network, the distance the request has to travel to the server, and any interruptions that occur along the lines of this request. A website does not have any control over the link between the user and server but any delays that occur will still impact their time to first byte.
2. The time is takes the host server to process that request and generate a response.
Once the host server receives the request from the client, it then generates the response. This involves the host server starting processes, making calls to the database, running web scripts and communicating with the other necessary systems on the network. Popular and commonly used strategies used by websites to reduce the time to first byte. include website caching, optimising the server-side code, and improving hardware resources.
3. The time it takes the host server to send the response back to the client.
After the response has been sent, it goes back to the initial user. This step is dependant on both the website’s connection speed and the end-users connection speed. The time to first byte. is quite literally the moment the user receives the first response and byte of data. The transmission of the request and network response can account for around 40% of the time to first byte.
An Example of Time to First Byte
The camera store spy-camera wanted to reduce their time to first byte which was 4 seconds and they wanted this down to 2 seconds. They devised a strategy which involved creating areas of the web page that changed depending on the user who was on it. This allowed the website to show personalised content in certain areas and for the rest of the content to be cached on a Content Delivery Network (CDN).
Spy-cam adapted their Magento store, their Content Management System (CMS) to cache everything except for specific pages and areas which change depending on the customer – the users shopping cart for example.
By adjusting the CMS and caching everything they managed to reduce their time to first byte from 1162ms to 152ms. This strategy of caching certain content resulted in the dynamic pages loading faster than static pages without causing any ill effects to the end-user experience.
The Benefits of Optimising Time to First Byte
Optimising the time to first byte provides benefits to both the end-user and the website/ content provider.
- Website users will see an increase in performance and an improved website browsing experience. This is due to them having to spend less time waiting for the website to load.
- The owner of the website will see higher conversions and time on site due to the customers not leaving due to delays and long load times.
The speed at which a website loads has a huge effect on the conversion and website retention rates. Users expect websites to load fast and 40% of users abandon a website if it takes more than 3 seconds to load, this means that having a low time to first byte is key to getting people onto the site to ensure they have a chance to explore it and engage with it.