Minimize Payload

These settings reduce the bytes your configuration sends. On an API the payloads are small individually, but they're JSON and XML — among the most compressible formats there are — and nothing is being served from cache, so compression applies to every single response.

brotli

Recommended.

{
  "name": "brotli",
  "options": {
    "enabled": true
  }
}

Lets edge servers cache and serve Brotli-compressed assets. Brotli compresses significantly better than Gzip, so response size and bandwidth both drop for clients that support it. When a client sends Accept-Encoding: br, Akamai serves the Brotli version; when it doesn't, Akamai falls back to Gzip or uncompressed automatically — which is why this is safe to leave on.

  • Resources need to be Brotli-compressed on your origin.
  • It covers more content types than Resource Optimizer or Last Mile Acceleration, and can compress non-cacheable resources — which, on this product, is nearly all of them.
  • If a Gzip version of a response is already cached, Akamai keeps serving it until its TTL expires. The Brotli version populates after that.
📘

Not every API client negotiates encoding

Browsers always send Accept-Encoding. Server-to-server HTTP clients frequently don't, and get uncompressed responses. That's safe but it means compression savings on an API are uneven — measure rather than assume.

gzipResponseTemplate

{
  "name": "gzipResponseTemplate",
  "options": {
    "gzipCompression": "ALWAYS",
    "contentType": [
      "application/javascript",
      "application/*javascript*",
      "application/json",
      "application/xml",
      "text/html*",
      "..."
    ]
  }
}

Optimizes the last mile between the edge and the client. The edge checks for Accept-Encoding: gzip before compressing, so clients that can't decompress aren't affected.

OptionShips asWhy
gzipCompressionALWAYSEvery matching response is compressed before delivery, including uncacheable ones — which is the only mode that does anything useful here, since the template caches nothing. ORIGIN_RESPONSE compresses only what your origin already compressed; NEVER disables it.
contentType38 entriesA list of MIME types — not file extensions — covering the text-based formats common to websites and apps, with wildcards. application/json, application/json*, application/+json, application/xml, and application/+xml are all in the shipped list, so standard and vendor-suffixed API media types are covered.

The full list is in the newEnvironmentVersionTemplate returned by Get product definition.

❗️

Custom media types aren't covered

The shipped list matches application/json* as a prefix, so application/json; charset=utf-8 compresses. A fully custom type like application/vnd.example.v2+json matches the application/vnd* entry — but something like application/x-myapi matches nothing and is sent uncompressed. If your API defines its own media type, check it against the list and add it.