x0 Home Gzip responses

Gzip responses (gzip_responses)

Roadmap: option-gzip-responses. Compress JSON/XML/text API bodies when the client asks for it. Cache stays uncompressed; gzip is serve-time only.

When it runs

  1. Explicit CustomerOption(gzip_responses):
  2. is_enabled=true → on (optional {"min_bytes": 1024, "level": 6})
  3. is_enabled=false → off
  4. Else Standard and Professional plans default on (min_bytes=1024, level=6).
  5. Lite / Free stay uncompressed unless the option is enabled.

Also required:

  • Request Accept-Encoding includes gzip
  • Content-Type is JSON, XML, OData, or text/*
  • Body is at least min_bytes (default 1024)
  • Response is not already encoded
  • Not applied to /docs, OpenAPI, or webhooks

If gzip would make the body larger, x0 leaves it uncompressed.

Client

GET /odata/v1/Accounts
Authorization: Bearer x0_live_….secret
Accept-Encoding: gzip

Success headers include Content-Encoding: gzip, X-X0-Gzip: 1, and Vary: Accept-Encoding. Most HTTP clients (curl --compressed, httpx, browsers) decompress automatically.

Cost

options_available.cost_egress_bytes_est is negative (planning estimate: less wire bytes). Access logs record the compressed Content-Length when gzip ran.

Sign in to see connection status