Skip to content

Instantly share code, notes, and snippets.

@mchv
Created June 13, 2016 14:56
Show Gist options
  • Save mchv/f6c1982c3e04fce6f6e29a962481286a to your computer and use it in GitHub Desktop.
Save mchv/f6c1982c3e04fce6f6e29a962481286a to your computer and use it in GitHub Desktop.
Fastly soft purge
FILEPATH=<YOUR PATH>
FASTLY_SERVICE_ID=<YOUR ID>
FASTLY_API_KEY=<YOUR API KEY>
SURROGATE_KEY=`md5 -qs '$FILEPATH'`
curl -X POST --header "Fastly-Soft-Purge: 1" --header "Fastly-Key: ${FASTLY_API_KEY}" https://api.fastly.com/service/${FASTLY_SERVICE_ID}/purge/${SURROGATE_KEY}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment