Search code examples
bashcurlwgetcdnfastly

Purge a URL from the Fastly CDN via API call with curl or wget


I use a bash script to deploy a static webpage which uses Fastly as a CDN. When /example.html gets deployed I would like to purge /example.html via their API within the bash script. I know that there is a good to go Ruby gem but I'd like to do it with curl or wget within the bash script.

How can I purge a given URL via the Fastly API with curl or wget?


Solution

  • via

    curl -X PURGE http://www.example.com/image.jpg

    as explained in their docs.