Ways to Test Your Caching with cURL

Comments

5 comments

  • 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 "199.27.79.20"

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

    Then run your command:

    Example:

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

    0
    Comment actions Permalink
  • Christoph

    That's awesome, thanks so much @cassandra!

    0
    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.

    0
    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.

    0
    Comment actions Permalink
  • Tom To

    I see *.hosts.fastly.net doesnt have AAAA (ipv6) support. Is there some way to send a request through a specific cache node via ipv6?

    0
    Comment actions Permalink

Please sign in to leave a comment.