Purging an image is the method used to force an image to drop out of cache. https://dashboard.imgix.com/tools
When to purge an image
Common reasons for purging an image are:
- An out-of-date or unwanted image is being served through your imgix Source (e.g. need to remove for DMCA compliance).
- You want to update an image in your Source without renaming the file.
How to purge an image
For a full list of methods for purging an image, see this tutorial below:
Purging best practices
Generally, it's recommended to always upload a new version of an image with a new name instead of purging an image.
Note that purges may take some time to finally be purged from the cache. If you're experiencing an issue where you're unable to purge the image, try following these steps:
- Delete the image from your Origin
- Purge the image using the purge tool or the API
- Verify the image has been purged by opening the URL (it should 404)
- Re-upload the image and purge one last time
What happens when you purge an image
imgix completes several options in sequence when a purge is requested:
- The request is revalidated against the image in your Source. If the image is unchanged (returns a 304 status code), then the purge process stops. This is why any changes to an image, such as replacement or removal, have to start with your Master Image at the Source.
- If the image registers as changed, then it’s either removed or replaced by the new version in imgix’s origin cache.
- A request is then sent to the imgix CDN to set the image’s TTL to 0s, thus forcing revalidation on subsequent requests for both the Master Image and all derivatives.
Purging does not remove images from any of the following, because they are outside of the imgix system:
- Your Source (Amazon S3, Google Cloud Storage, etc.)
- Any third-party CDNs you might use in addition to the imgix CDN
- The end user’s browser cache
- Any ISP caches between imgix and the end user
Because of this, it is still possible for the end user to see an out-of-date image on occasion. Please contact Support if you need help with purging operations.