Skip to content

非公式 / UnofficialCloudflare, Inc. 非提携。アカウント情報は入力しないでください。Not affiliated with Cloudflare, Inc. Do not enter Cloudflare credentials here.Official docsこのサイトについてプライバシー

Flexible variants を有効にする

最終更新 Markdown で表示Agent セットアップ

Flexible variants を使うと、動的リサイズのバリアントを作成できます。通常のバリアントより選択肢が増えます。このオプションはデフォルトでは無効です。

Cloudflare ダッシュボードで flexible variants を有効にする

  1. Cloudflare ダッシュボードで Hosted Images ページを開きます。

    公式ダッシュボードで Hosted images を開く ↗
  2. Delivery タブを選択します。

  3. Flexible variants を有効にします。

API で flexible variants を有効にする

バリアントを更新するエンドポイント に PATCH リクエストを送信します。

curl --request PATCH https://api.cloudflare.com/client/v4/accounts/{account_id}/images/v1/config \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{"flexible_variants": true}'

有効化後は、任意の Cloudflare 画像に 最適化パラメーター を使えます。例:

https://imagedelivery.net/{account_hash}/{image_id}/w=400,sharpen=3

役に立ちましたか?