ImageKit.io provides two methods to clear the cache for a particular image URL.
Using the Dashboard.
Navigate to Purge Cache within the dashboard
Click on 'New Request' at the top right corner of the page to open a popup.
Enter the full image URL for which you want to clear the cache. If the URL contains path transformation parameters or query transformation parameters, add those parameters as well to clear the cache. You can enter multiple URLs separated by a new line, and a maximum of 100 URLs can be submitted in a single request.
You can purge the cache for multiple files within a directory by appending a wildcard at the end of the URL, only if ANY ONE of the following conditions are met:
The path consists of at least two levels of nesting:
The path of the directory, excluding your imagekitId and URL pattern, contains at least two levels of nesting, starting from the root as shown below:
For example, the path
/images/upload* is valid, but
/images* is not.
The path length is at least 15 characters:
The path of the directory, excluding your imagekitId and URL pattern, is at least 15 characters in length, as shown below:
However, if the first condition is met, i.e. the path consists of at least two levels of nesting, then it need not be 15 characters long.
The path is a complete file path:
The path specified is a complete path pointing to a file, with the file extension present at the end of the path, as shown below:
For example, the path
/sample.jpg* is valid, despite not being 15 characters long, or having two levels of nesting.
Note that the wildcard can only be appended at the end of a URL. Wildcards within the path are not supported. i.e.
/folder/*/sample.jpg is an invalid path. Please reach out to us at email@example.com if you need to purge all images on a specific pattern not supported through the dashboard.
Click 'Submit' and allow a few minutes for the cache to clear. It would be best if you refreshed the dashboard to get the updated cache clear status.
You can clear 1000 URL caches in a month from a single account (from both the dashboard and Purge API combined). When you reach this limit, cache clear requests get blocked on your account. If you need more cache clear requests within a month, please create a support ticket through the dashboard or email us at firstname.lastname@example.org.