Hey, so what is happening is something is getting caught in my Clouflare cache that is preventing using the contact forms on my website. After I clear the CF cache, the forms will work fine for a few hours and then they stop working again. Can I add a cron job to clear the cache at regular intervals? If coding is needed can you show me an example of what it would look like?
You can make a bash script or something and schedule it via cron. You can use the Cloudflare API to purge all files or purge files by URL. I suppose, your other option, may be to bypass whatever is causing problems when it’s cached from being cached to begin with.
Hey there!
I am not sure if this is the best way to solve your issue, but lacking any better solution, i have done this once before.
You’ll need to setup an API key, ideally with only the privilege to access the single zone and permission you require.
Then you can setup a cron job with a curl command:
Something along the lines of this should do the trick, please excuse if escaping of characters is not 100% but I did it using Postman and automated it with Newman.