I make a Bunny CDN Perma Cache Auto Clearer Webhook

This can be easily integrate to the Ghost blog for people who is using Bunny CDN as their CDN.

Source Code: Github Repo

Motivation

According to the Bunny CDN official documentation, in a full pull zone purge complete purge, the Perma-Cache retains the files but shifts to a new directory structure within the storage zone. If needed, you must manually delete the old cache folder.

Perma-Cache is expensive, and sometimes you could easily forgot to clear the old cache folder, which will make them take tons of space which will cost your money.

That’s why I make this webhook so that you can easily integrate to your website to automatically clear the old cache folder whenever you want to trigger it.

Features

  • Immediate cache clearing upon a POST request.
  • Scheduled cache clearing at intervals of 1 minute and 3 minutes.
  • Logging of cache clearing activities and thread status.
  • Thread-safe execution using locks to prevent concurrent cache clearing.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes or enhancements.

4 Likes