Cache Clear
Clay Kiln Plugin to Clear Fastly Cache
Requirements
The Kiln project that is going to use this plugin should set the following environment variable:
FASTLY_API_KEY=cool-api-key
If FASTLY_API_KEY
is not provided, the plugin will fall back to making unauthenticated HTTP requests
with the PURGE
method. This is a good option if using IP origin rules for allowing purges.
Getting Started
- Install the package as a dependency
npm install --save cache-clear
- Create a directory for your plugin inside the kiln/plugins directory in the services section
mkdir PROJECT_DIRECTORY/app/services/kiln/plugins/PLUGIN_NAME
- Create an
index.js
file in the previous directory created, importing main components for the plugin and setting them in the specificwindow.kiln
object.
// index.js const NavButton NavContent CacheClearPlugin } = ; // Used to export components to the window elementmodule { windowkilnnavButtons'cache-clear' = NavButton; windowkilnnavContent'cache-clear' = NavContent; windowkilnplugins'cache-clear' = CacheClearPlugin;};
- At
app/services/kiln/index/js
require the previously created file
;