コンテンツにスキップ

APIを介してルールを作成する

Rulesets APIを使用して、APIを介して圧縮ルールを作成します。

基本的なルール設定

APIを介して圧縮ルールを作成する際は、以下の点に注意してください:

  • ルールアクションをcompress_responseに設定します。
  • action_parametersフィールドで、マッチするリクエストに対して上書きしたい設定に従ってパラメータを定義します。
  • ルールをゾーンレベルのhttp_response_compressionフェーズにデプロイします。

手順

Follow this workflow to create 圧縮ルール for a given zone via API:

  1. Use the List zone rulesets operation to check if there is already a ruleset for the http_response_compression phase at the zone level.

  2. If the phase ruleset does not exist, create it using the Create a zone ruleset operation. In the new ruleset properties, set the following values:

    • kind: zone
    • phase: http_response_compression
  3. Use the Update a zone ruleset operation to add 圧縮ルール to the list of ruleset rules. Alternatively, include the rule in the Create a zone ruleset request mentioned in the previous step.

例リクエスト

例のAPIリクエストについては、Rules examples galleryを参照してください。