Ways to Test Your Caching with cURL



  • Cassandra Dixon

    You will want use --resolve in your curl command:

    curl -svo /dev/null --resolve '<customer_hostname>:443:<ip address of cache node>' <https URL>

    There are a few things you will need to confirm before running this command: * That you have TLS enabled with Fastly via a Shared Certificate or Hosted Cert * Determine the IP address of the cache node

    For instance: host cache-lax1420.hosts.fastly.net cache-lax1420.hosts.fastly.net has address ""

    Note: If you have a hosted certificate, change the last octet to match your dedicated map

    Then run your command:


    curl -svo /dev/null --resolve 'www.example.com:443:' https://www.example,com/some_file

    Comment actions Permalink
  • Christoph

    That's awesome, thanks so much @cassandra!

    Comment actions Permalink
  • Rogier Mulhuijzen

    Another tip is to use --compressed so that curl sends Accept-Encoding: deflate, gzip, to mimic browser behavior a little more closely.

    And it's always a good idea to test both with and without --compressed to make sure that responses are compressed when they should be and aren't when they shouldn't. Content-Encoding: gzip in the response headers signifies that the response is compressed.

    Comment actions Permalink
  • paolo mainardi

    To test with a loop: watch -n [number] curl -svo /dev/null [url] -H "Fastly-Debug: true"

    Where "number" is an integer.

    Comment actions Permalink

Please sign in to leave a comment.