DEV Community

Cover image for Check quickly the TTFB via terminal
Rafael Corrêa Gomes
Rafael Corrêa Gomes

Posted on • Edited on • Originally published at blog.rafaelcg.com

Check quickly the TTFB via terminal

For a long time, an alias helped me to return the TTFB during my dev tests, and talking with beginner developers I noticed that something small as an alias could be simpler, so I created a simple and developer-friendly tool to help beginners in a developer team to have access to this solution.

To install the TTFB Terminal you just need to run the command below.

bash <(curl -s https://raw.githubusercontent.com/rafaelstz/ttfb-terminal/master/setup-ttfb)
Enter fullscreen mode Exit fullscreen mode

ttfb terminal - rafael correa gomes

Why?

You can use this tool to check the server response and detect some kind of issues, for example:

  • Network issues
  • Dynamic content creation
  • Web server configuration
  • Amount of traffic

What's TTFB?

According to KeyCDN. TTFB, which stands for time to the first byte, is the amount of time it takes from when a client makes an HTTP request to it receiving its first byte of data from the webserver. TTFB is an important aspect of website optimization since the faster the TTFB, the faster the requested resource can start being delivered to the browser.

The time to the first byte is made up of three separate components.

  • The time needed to send the HTTP request
  • The time needed for the server to process the request
  • The time needed for the server to send back the first byte of the response to the client

Thanks!

How do you usually check the TTFB? Do you know some other alias that can easily become a tool? Let me know in the comments below.

Top comments (2)

Collapse
 
sm0ke profile image
Sm0ke

nice

Collapse
 
rafaelcg profile image
Rafael Corrêa Gomes

thanks