Skip to content

Instantly share code, notes, and snippets.

@danielantelo
Last active December 28, 2017 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielantelo/174638b12678bf91ef95cebff67f736f to your computer and use it in GitHub Desktop.
Save danielantelo/174638b12678bf91ef95cebff67f736f to your computer and use it in GitHub Desktop.
script to get ttfb of a website
#!/bin/bash
# command to check the time to first byte
# ** usage **
# 1. ./ttfb "https://www.apple.com/"
# 2. seq 10 | xargs -Iz ./ttfb "https://www.apple.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