gzip_​response

Version: v2025-01-13Includes use: Yes

Behavior name: Last Mile Acceleration (Gzip Compression)

Apply gzip compression to speed transfer time. This behavior applies best to text-based content such as HTML, CSS, and JavaScript, especially once files exceed about 10KB. Do not apply it to already compressed image formats, or to small files that would add more time to uncompress. To apply this behavior, you should match on content_type or the content's cacheability.

Default behavior

These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.

data "akamai_property_rules_builder" "gzip_response" {
  rules_v2025_02_18 {
    name     = "Last Mile Acceleration (Gzip Compression)"
    comments = "Applies gzip compression to speed transfer time."
    behavior {
      gzip_response {
        behavior = "ORIGIN_RESPONSE"
      }
    }
  }
}
"behaviors": [
  {
  "name": "gzipResponse",
  "options": {
    "behavior": "ORIGIN_RESPONSE"
    }
  }
]

Options

Option Description
behavior
Specify when to compress responses. Value is one of:
  • ORIGIN_RESPONSE. Compress for clients that send an Accept-Encoding: gzip header.
  • ALWAYS. Always compress.
  • NEVER. Never compress.