1.0.2 • Published 1 year ago

@dotdev/sanity-plugin-cloudflare-cache v1.0.2

Weekly downloads
-
License
UNLICENSED
Repository
gitlab
Last release
1 year ago

Sanity Plugin Cloudflare Cache

Simple plugin to clear the cache within Cloudflare. This package provides a Sanity dashboard widget which triggers builds and within Gatsby Cloud.

Installation

yarn add @dotdev/sanity-plugin-cloudflare-cache
# or
npm i @dotdev/sanity-plugin-cloudflare-cache --save

Add the plugin to the plugins array in sanity.json.

"plugins": [
  // ...rest of plugins
  "@dotdev/sanity-plugin-cloudflare-cache"
]

If you have not already, append the following to the parts array in sanity.json.

{
  "implements": "part:@sanity/dashboard/config",
  "path": "dashboardConfig.js"
}

Create the file dashboardConfig.js and include the widget like this.

export default {
  widgets: [
    {
      name: "cloudflare-cache",
    },
  ],
}

Configuration

The plugin can be configured through <your-studio-folder>/config/cloudflare-cache.json:

{
  "sites": [
    {
      "title": "Staging",
      "url": "https://preview-yoursite.gtsb.io/api/webhook-cloudflare-cache-purge"
    },
    {
      "title": "Production",
      "url": "https://yoursite.gtsb.io/api/webhook-cloudflare-cache-purge"
    }
  ]
}

License

MIT © DotDev See LICENSE

1.0.2

1 year ago

1.0.1

1 year ago