Skip to content

Instantly share code, notes, and snippets.

@liquid207
Forked from sandeepraju/ttfb.sh
Created February 16, 2022 07:41
Show Gist options
  • Save liquid207/4832245a4b658d6e087f3a9a8847b134 to your computer and use it in GitHub Desktop.
Save liquid207/4832245a4b658d6e087f3a9a8847b134 to your computer and use it in GitHub Desktop.
curl command to check the time to first byte
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment