cURL Top Codes

List of Top and Popular cURL Codes and example.

Learn API data transfer, TTFB test and REST API interaction using curl request and commands.

curl command to check TTFB

What is TTFB?

TTFB stands for time to first byte.  It is used to determines the responsiveness of a web server or network. TTFB is the duration between when a client makes an HTTP request and when the first byte of the page received by the client’s browser.

curl command to check TTFB of website:

We can check TTFB using following curl command in Terminal or Command Line Tool.

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

This command will provide Connection Time, TTFB & Total Time for the given website.

Check TTFB Using Chrome Dev Tools:

You can also check TTFB of whole page or individual resources using Chrome Developer Tools.

  1. Go to Chrome Browser > View > Developer Tools > Network
  2. Reload the page
  3. Mouseover the first Waterfall section on Network resource and You can see Waiting (TTFB) time for the whole page.

Note: TTFB time in a web browser is not as accurate as of curl because of the browser cache. TTFB also depends on your network speed, server location and your location. Therefore, there can be different TTFB based on these factors.

TTFB Testing Tools:

Website Speed Test (Overall):