Add the Fastly-Debug: True header to a request
curl -svo /dev/null [url] -H "Fastly-Debug: true"
Purpose: provides more information about how the object is cached and handled by Fastly caches.
The following three headers are included in the object response:
Fastly-Debug-Path: which cache servers serve the request
Fastly-Debug-TTL: the TTL of the object in the queried server(s)
Fastly-Debug-Digest: the hash digest of the object.
Run a request through a specific cache node
curl -svo /dev/null <url> -x <cache-node>.hosts.fastly.net:80
In the place of
<cache-node>, you can insert any cache node that you usually see in the “X-Served-By” header on a response (ie cache-jfk1020, cache-lax1427, cache-fra1246, etc) running through Fastly.
Purpose: allows you to target your testing and make multiple calls to the same cache server. This can be useful for testing HIT/MISS, TTL values, or to check if the cache is correctly serving different versions of an object (for example if GZIP is enabled).
Add the Fastly-No-Shield: true header to a request
curl -svo /dev/null [url] -H "Fastly-No-Shield: true"
Purpose: Disables clustering on the request. This may help you see what the request/response looks like when one cache server communicates directly with your origin.
Test a URL with a loop:
for ((i=1;i<=10;i++)); do curl -svo /dev/null www.example.com; sleep 2; done
while true; do curl -svo /dev/null www.example.com; sleep 2; done
Purpose: this is convenient for seeing the results from numerous url calls and can also be helpful for testing logging output/performance.
To monitor for the presence of certain headers (Etag, Content-Type, etc) in a sample of responses:
for ((i=1;i<=1000;i++)); do curl -svo /dev/null www.example.com 2>&1 | grep Etag; sleep 1; done
while true; do curl -svo /dev/null www.example.com 2>&1 | grep Content-Type; sleep 1; done
Please sign in to leave a comment.