Purge cache by URL
Selective purge by file; note: purge_everything thrashes cache, avoid in prod
curl -sX POST "https://api.cloudflare.com/client/v4/zones/<id>/purge_cache" -H "Authorization: Bearer $CF_TOKEN" -H 'Content-Type: application/json' --data '{"files":["https://<host>/app.js"]}'
- tool
- cloudflare2 commands
More cloudflare commands
-
curl -sX POST "https://api.cloudflare.com/client/v4/zones/<id>/dns_records" -H "Authorization: Bearer $CF_TOKEN" -H 'Content-Type: application/json' --data '{"type":"A","name":"<host>","content":"<ip>","proxied":true,"ttl":1}'Add A record behind CF proxy; proxied=true requires ttl=1 (auto)