Last active
December 29, 2020 12:20
Purge Cache CloudFlare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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