Create a compression rule via API · Cloudflare Rules docs | Latest TMZ Celebrity News & Gossip | Watch TMZ Live Skip to content
Cloudflare Docs

Create a compression rule via API

Use the Rulesets API to create a compression rule via API.

Basic rule settings

When creating a compression rule via API, make sure you:

  • Set the rule action to compress_response.
  • Define the parameters in the action_parameters field according to the settings you wish to override for matching requests.
  • Deploy the rule to the http_response_compression phase at the zone level.

Procedure

Follow this workflow to create a compression rule 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 a compression rule to the list of ruleset rules. Alternatively, include the rule in the Create a zone ruleset request mentioned in the previous step.

Examples

For example API requests, refer to the Examples gallery.

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.