Since Drupal 10 Removed jQuery dependency from the once feature → , I've re-rolled the patch for Drupal 10 once compatibility. If you're not on D10, use the patch #5.
brunapimenta → created an issue.
Adding a patch file with the same solution used on the fork just to be easier to apply on Production websites.
I've provided a fork removing Cloudflare SDK dependency, for that I've chosen to bring to Cloudflare Drupal module the SDK needed code - in which is the one related to Zone (listing and caching purge).
It was validated using a Drupal vanilla installation, everything worked smoothly after applying #3346396 - admin/config/services/cloudflare Slow to Load 🐛 admin/config/services/cloudflare Slow to Load RTBC solution.
Note
Since SDK code followed an Object-Oriented Programming, I've kept as is. Even though at the end it looked a complex solution to a simple need, it can provide flexibility porting more code from that library on the future.
During the development of #3362051 - Cloudflare PHP SDK is abandoned, affects v1 and v2 ✨ Cloudflare PHP SDK is abandoned, affects v1 and v2 Needs review I could face the same issue and this solution worked perfectly. :)
I'll start taking a look on suggestion of the Comment on Github, wherein Cloudflare indicates the usage of API directly.
Adding the initial patch for this issue. I've tested locally, but I would like to get community review.
brunapimenta → created an issue.