You can use cURL or Drush to clear your CloudFlare cache by URL, Cache Tags, Hostname, or Prefix.
If you need your ZONE_ID or API_TOKEN please send a message to [email protected]
Purge by URL:
curl -X POST "https://api.cloudflare.com/client/v4/zones//purge_cache" \
-H "Authorization: Bearer " \
-H "Content-Type: application/json" \
--data '{"files":["https://example.com/file1.jpg", "https://example.com/file2.css"]}'
Purge by Cache Tags, Hostname, or Prefix:
curl -X POST "https://api.cloudflare.com/client/v4/zones//purge_cache" \
-H "Authorization: Bearer " \
-H "Content-Type: application/json" \
--data '{"tags":["tag1", "tag2"]}'
Using Drush:
- Ensure Drush is installed and configured on your server.
- Use the command drush cc bin to clear a specific cache or all Drupal caches.
- To clear the entity and bootstrap cache bins, use drush cc bin entity,bootstrap.
- For more detailed options and to see all global options, run drush topic and select the first choice.
- This process ensures that your site's cache is up-to-date with the most recent data, which is crucial for optimal performance and user experience.
