-
-
Save dbalabka/b9b8a9b59c66f4335fa21b436b6bf056 to your computer and use it in GitHub Desktop.
cURL command to check the request timing (including TTFB)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 "DNS lookup:\t\t%{time_namelookup} seconds\nConnect:\t\t%{time_connect} seconds\nApp Connect:\t\t%{time_appconnect} seconds\nPretransfer:\t\t%{time_pretransfer} seconds\nStart transfer (TTFB):\t%{time_starttransfer} seconds\nTotal:\t\t\t%{time_total} seconds\nSize:\t\t\t%{size_download} bytes\n" \ | |
$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment