Clear cache with webhook

I wonder if there is a way to trigger a build with cached clear other than the button in the app.

I’d like to run a request to a webhook everyhour, or via a link so we can manually refresh the cash. Maybe there is an environment variable I am not aware of?

2 Likes

Hi @regisphilibert,

There isn’t a webhook for it, but you should be able to using our API. I recommend checking the dev tools when you click that deploy button and you can see the API call that our app makes to trigger a build with clear cache.

2 Likes

Perfect! Thanks @futuregerald.

2 Likes

You’re welcome, Buddy!

Hi @futuregerald ,

Are there any plans on having an option for a webhook to clear the cache before building?

For some reason, my build only works when the cache is cleared & I want to be able to set up a Contentful <> Netlify integration using the webhook.

Thanks!

As @futuregerald mentioned, there is no webhook but there is an API endpoint for it. Perhaps you could set up a Lambda function that calls this API and then the build hook?