Skip to content

Instantly share code, notes, and snippets.

@etc-tiago
Last active December 29, 2020 12:20
Show Gist options
  • Save etc-tiago/98db34fd055fd2801521bae5f19c79fb to your computer and use it in GitHub Desktop.
Save etc-tiago/98db34fd055fd2801521bae5f19c79fb to your computer and use it in GitHub Desktop.
Purge Cache CloudFlare
const fetch = require("isomorphic-unfetch");
fetch("https://api.cloudflare.com/client/v4/zones/95bf6374709dc5a530c1e74476b580bc/purge_cache", {
method: "POST",
headers: {
"X-Auth-Email": "YOUR_EMAIL_DASHBOARD_HERE",
Authorization: "Bearer YOUR_TOKEN_HERE",
"Content-Type": "application/json",
},
body: JSON.stringify({ purge_everything: true }),
}).then((r) => {
console.log("Purge Cache");
return r.json();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment