Simple php purge script
<?php
try {
$head = [];
$head[] = 'Content-Type: application/json';
$head[] = 'X-Auth-Email: [email protected]';
$head[] = 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxx';
$head[] = 'cache-control: no-cache';
$url = 'https://api.cloudflare.com/client/v4/zones/xxxxxxxxxxxx/purge_cache';
//$purge = ['purge_everything' => true];
$purge = ['files' => ['https://www.xxxxxxxxx.tld/pub/static/frontend/xxxxxxx.js']];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($purge));
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
}
catch(Exception $e) {
print($e);
}