Skip to content

Instantly share code, notes, and snippets.

View tralston's full-sized avatar

Taylor Ralston tralston

  • Sacramento, CA
  • 15:07 (UTC -07:00)
View GitHub Profile
@tralston
tralston / curl-ttfb.sh
Created October 28, 2016 22:22 — forked from acdha/curl-ttfb.sh
Use curl to measure and report HTTP response times (pre-, start- and total transfer)
#!/bin/bash
#
# Report time to first byte for the provided URL using a cache buster to ensure
# that we're measuring full cold-cache performance
while (($#)); do
echo $1
curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \
-w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \
"$1?`date +%s`"