I want to add a request to CloudFlare API to delete the image from cache.
Please tell me where is the delete function located and what variables are available in it?
Thank you!
As I see that you're not too busy now, can you point this out for me?
I just need to make a quick file_get_contents to CloudFlare API to purge the file.
Thank you!
To anyone who wonder how to purge images from CloudFlare when deleting it, here is my solution.
+ root>app>lib>classes>class.image.php
find (and please check that it have to be in delete function)
PHP:
$target = $image_db[$file_delete];
and add this code under it (edit it to fit your configuration)
To be clear, this will not immediately delete images from Cloudflare, it will send a request to Cloudflare to purge the file. It would take up to a few minutes for the image to be deleted. Otherwise, if we don't send a request, the image would stay on their CDN for hours or days.