Create a compression rule in the dashboard
Last updated Apr 16, 2026 1. In the Cloudflare dashboard, go to the Rules Overview page. Go to Overview ↗ 2. Select Create rule > Compression Rule. 3. (Optional) Select one of the rule templates that address common use cases. Then, review and adjust the proposed rule configuration. 4. Enter a descriptive name for the rule in Rule name. 5. Under When incoming requests match, select if you wish to apply the rule to default content types (content types that Cloudflare compresses by default), or to requests that match a custom filter expression. 6. (Optional) To define a custom expression, use the Expression Builder (specifying one or more values for Field, Operator, and Value) or manually enter an expression using the Expression Editor. For more information, refer to Edit expressions in the dashboard. 7. Under Compression options, set the compression options. 8. To save and deploy your rule, select Deploy. If you are not ready to deploy your rule, select Save as Draft.
If you are matching a hostname in your rule expression, you may be prompted to create a proxied DNS record for that hostname. Refer to Troubleshooting for more information.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/rules/compression-rules/create-dashboard/#page","headline":"Create a compression rule in the dashboard","description":"Create compression rules in the Cloudflare dashboard.","url":"https://developers.cloudflare.com/rules/compression-rules/create-dashboard/","inLanguage":"en","image":"https://developers.cloudflare.com/rules/compression-rules/create-dashboard/og.png?v=304d14ecfc833097","dateModified":"2026-04-16","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Example Compression Rules for Brotli, Gzip, and Zstandard configurations. title: Compression Rules examples image: https://developers.cloudflare.com/rules/compression-rules/examples/og.png?v=40799f09e764a792
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/rules/llms.txt
Use this file to discover all available pages before exploring further.
Docs