Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Grab Fastly debugging info from cache.nixos.org
#!/usr/bin/env bash
[ -z "$1" ] && echo "ERROR: must provide arg" && exit 1
CACHE_URL=${CACHE_URL:-"https://cache.nixos.org"}
curl -v \
-HFastly-Debug:1 \
-o /dev/null 2>&1 \
"$CACHE_URL/$1" \
| grep -E '(fastly-debug|served-by|cache)'
@thoughtpolice

This comment has been minimized.

Copy link
Owner Author

thoughtpolice commented Aug 1, 2019

Example:

a@link> ./fastly-cache-debug.sh pwih6g12kymmk9nccajz7a934cp6n63h.narinfo

* Connected to cache.nixos.org (2a04:4e42::729) port 443 (#0)
*  subjectAltName: host "cache.nixos.org" matched cert's "cache.nixos.org"
> Host: cache.nixos.org
< fastly-debug-path: (D cache-dfw18637-DFW 1564664287) (F cache-dfw18645-DFW 1564663711)
< fastly-debug-ttl: (H cache-dfw18637-DFW 85823.753 0.000 576)
< fastly-debug-digest: 58e04fb08c285fa89bb1f7a7dd2123ee4bd04488df8bbf86c2fd074bae15490a
< x-served-by: cache-dfw18637-DFW
< x-cache: HIT
< x-cache-hits: 2
* Connection #0 to host cache.nixos.org left intact

More information on Fastly-Debug: 1 is available here: https://support.fastly.com/hc/en-us/community/posts/360040167211-Deciphering-Fastly-Debug-header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.