LoginSignup
0
0

More than 3 years have passed since last update.

Imgixメモ

Last updated at Posted at 2019-11-05

カスタムドメイン

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);

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0