Check ttfb (time to first byte) with bash script

From DevOps Notebook
Revision as of 18:16, 27 January 2022 by MilosZ (talk | contribs) (Created page with "<syntaxhighlight lang="bash"> #!/bin/bash # file: ttfb.sh # curl command to check the time to first byte # ** usage ** # 1. ./ttfb.sh "https://google.com" # 2. seq 10 | xargs...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"

curl -o /dev/null \
     -H 'Cache-Control: no-cache' \
     -s \
     -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" \
$1