- Fastly Status
Purging optimized images
Last updated April 18, 2017
Instant Purging removes an image from Fastly caches immediately so it can be refreshed from your origin servers.
To purge images using key-based purging, determine the appropriate purge key to use and then follow one of the key-based purging methods below.
Determining the appropriate purge key
The purge key represents the path of your origin image without the Fastly Image Optimizer query string URL API parameters. For example, if the image URL is
http://www.fastly.io/image.jpg?width=205, then the purge key is
If your origin image requires adding origin query string parameters to the request these must be included in the purge key also. For example, if the image URL with parameters is
http://www.fastly.io/image.jpg?width=205&origin-token=foo, then the purge key is
Purging an image via the user interface
- Log in to the Fastly web interface and click the Configure link.
- From the service menu, select the appropriate service.
From the Purge menu, select Purge Key. The Purge Key window appears.
- In the Key field, type the path to the origin image plus any origin query string parameters that may require being passed to the Fastly Image Optimizer.
- In the Password field, type your Fastly password.
- Click the Purge button.
Purging an image via API
curl -H "Fastly-Key: FASTLY_API_TOKEN" -X POST https://api.fastly.com/service/SERVICE-ID/purge/PURGE-KEY
Soft Purging an image via API
curl -H "Fastly-Key: FASTLY_API_TOKEN" -H "Fastly-Soft-Purge: 1" -X POST https://api.fastly.com/service/SERVICE-ID/purge/PURGE-KEY