PHP Cloudflare Cache Silme
![PHP Cloudflare Cache Silme](https://php.university/uploads/images/2021/09/image_750x_613f2c228a41a.jpg)
Aşağıdaki bilgileri kendinize göre düzenleyerek cloudflare cache silme işlemini yapabilirsiniz.
<?php
$authKey = "??";
$authEmail = "???";
$zoneId = "???";
$endpoint = "purge_cache";
$data = [
"purge_everything" => true
];
$url = "https://api.cloudflare.com/client/v4/zones/{$zoneId}/{$endpoint}";
$opts = ['http' => [
'method' => 'DELETE',
'header' => [
"Content-Type: application/json",
"X-Auth-Key: {$authKey}",
"X-Auth-Email: {$authEmail}",
],
'content' => json_encode($data),
]];
$context = stream_context_create($opts);
echo $result = file_get_contents($url, false, $context);