Skip to content

Instantly share code, notes, and snippets.

@acdha
Created November 28, 2011 23:03
Show Gist options
  • Select an option

  • Save acdha/1402514 to your computer and use it in GitHub Desktop.

Select an option

Save acdha/1402514 to your computer and use it in GitHub Desktop.

Revisions

  1. acdha renamed this gist Nov 28, 2011. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion curl-ttfb → curl-ttfb.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    #!/bin/bash
    #
    # Report time to first byte for the provided URL using a cache buster to ensure
  2. acdha created this gist Nov 28, 2011.
    13 changes: 13 additions & 0 deletions curl-ttfb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@

    #!/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`"
    shift
    done