Skip to content

fuelviews/cloudflare-cache-purge-buildpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Original README:

☁️ 🔥 💵 🔪

Purges your Heroku application's Cloudflare cache on deployment.

This buildpack makes use of Heroku's built-in multi buildpack functionality to make a HTTP POST request to the Cloudflare purge all files API. Each time you deploy your Heroku app, the cache will be cleared.

Configuration

You will need:

  1. Your Cloudflare API key and email address
  2. The Zone ID of the site that Cloudflare is caching

Run the following against your Heroku application:

heroku config:set [email protected]
heroku config:set CF_ZONE_ID=my_zone_id
heroku config:set CF_AUTH_KEY=my_cloudflare_api_key

heroku buildpacks:add https://github.com/jamesmartin/cloudflare-cache-purge-buildpack.git
git push heroku master

Getting your Zone ID

The Cloudflare Zone ID for your site can be obtained via the API:

  1. Clone this repository locally
  2. Edit the cf file to include your Cloudflare API key and email address
  3. Run the zones command:
  $ ./cf bin/zones
  1. Find the Zone ID of your site in the JSON output of zones. E.g:
{
  "result": [
  {
    "id":"this-is-your-zone-id",
    "name":"example.com",
    "status":"active",
    ...

About

Purges your Heroku application's Cloudflare cache on deployment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%