Analyze Your Website’s TTFB (Time to First Byte)

Have you improved the load time of your websites and web applications recently? Or, maybe your web store or other web app is now slower to respond as you’ve added more features or due to data growth? The time it takes for your web applications to respond when users visit is more important than ever before! After seeing the tangible benefits of reducing server response, network connect, and page load times of this blog, I can attest to this. Without going into specifics, a few of the benefits include longer time-on-site, increased engagement and more conversions, to name a few.

That said, as it pertains to the end-user performance of your web applications, where should you start? This will vary case by case. For example, let’s say your WebDev team did a clumsy job of optimizing your application’s performance. Thus, when you scan your page using tools such as GTmetrix, Pingdom tools (a blog sponsor), etc. The results look something like this:

GTmetrix poor score

…in this case, you have a lot more things to address before looking seriously into TTFB. However, if your frontend test result looks closer to the screenshot below, most times, you can continue to improve page load times by reducing your TTFB.

Low TTFB can achieve this by optimizing and improving your network connection and back-end (server) response times. In brief, some of the factors that can cause slow TTFB are: DNS resolution, database, server-side scripting, server hardware, poorly configured server, lack of caching, web host network and upstream performance. To successfully troubleshoot and lower your TTFB, you may need professional help. For this article, we will be looking at analyzing TTFBAlso, see 100+ Top Server Monitoring & Application Monitoring Tools.


What is TTFB?

Time spent waiting for the initial “server response” is also known as the Time To First Byte (TTFB). This time captures the latency of a round trip to connect the client to the server, plus the time spent waiting for the server to deliver a response. (Source: High TTFB is usually a sign of one or both of the following issues: 1) Poor network conditions between client and server or 2) Slow-to-respond web application/server.

High TTFB will often cause your page loads to be mysteriously slow or, at the very least, increase the latency between page loads. You should check to see if your TTFB is a performance issue or not. Try to keep TTFB under 200 milliseconds. 2nd+ requests should be even lower.


TTFB check using CURL

Here’s a quick example of using CURL to check TTFB from your Linux or Mac terminal app. Use the following command replacing “” with your domain:

curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n"

Example output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 34782    0 34782    0     0   143k      0 --:--:-- --:--:-- --:--:--  144k
Connect: 0.018 TTFB: 0.231 Total time: 0.236


Additional TTFB check methods (using a web browser)

ttfb check

In addition, to curl, you can check TTFB using these tools.

Related reading: Nginx tuning tips: TLS/SSL HTTPS – Improved TTFB/latency

Last updated: August 9th, 2021


Tags: , ,