Purge from curl using local enviroment variables
1
| curl -i -X POST "https://api.fastly.com/service/${FASTLY_API_SERVICE}/purge_all" -H "Fastly-Key: ${FASTLY_API_TOKEN}" -H "Accept: application/json"
|
Fastly CLI — Install
1
| brew install fastly/tap/fastly
|
Fastly CLI — Authenticate
Fastly CLI — Deploy a Service
Fastly CLI — Tail Live Logs
1
| fastly log-tail --service-id={service_id}
|
Fastly CLI — List Services
Check Cache Status of a URL
Look for X-Cache and X-Cache-Hits in the response headers:
1
| curl -sI https://example.com/path | grep -i "x-cache\|age\|surrogate"
|
Edge Dictionary — Read a Value in VCL
1
2
| declare local var.value STRING;
set var.value = table.lookup(my_dictionary, req.http.host);
|
| Header | Meaning |
|---|
X-Cache: HIT | Served from Fastly cache |
X-Cache: MISS | Fetched from origin |
X-Cache-Hits: 3 | Hit count for this object |
Age: 120 | Seconds object has been cached |
Fastly-Debug-Digest | Internal object hash |