カスタムドメイン
sourcesの設定からカスタムドメインを作成可能
カスタムドメインでhttpsを使う場合には、サポートセンターに問合せをし、追加料金を支払う必要がある
キャッシュ削除
複数一括削除は不可なので、
apiを使用してループ処理で一括削除を行う。
以下キャッシュ削除処理メモ
$domain_name = 'https://hogehoge.imgix.net';
$api_key= '************';
$file_path = '/img/test.png';
$headers = array(
'Content-Type:application/json',
'Authorization: Basic '. base64_encode($api_key.':')
);
$payload = json_encode(array("url" => $domain_name. $file_path));
$curl = curl_init('https://api.imgix.com/v2/image/purger');
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
return curl_exec($curl);