Content · Response header
Content-Encoding
How the body has been transparently encoded (usually compressed).
What is Content-Encoding?
Content-Encoding tells the client that the payload has been transformed — typically compressed with gzip, br (Brotli), or deflate — and must be decoded before the underlying Content-Type applies. Enabling compression can cut transfer size by 70–90%.
Typical usage
Set by servers when serving compressed responses. Clients advertise which encodings they accept with Accept-Encoding.
Examples
Brotli-compressed HTML
Content-Encoding: brgzip-compressed JSON
Content-Encoding: gzipCommon gotchas
Do not confuse Content-Encoding (transport transformation) with the media type application/gzip (the resource itself is a gzip file). The two mean different things.
Specification
RFC 9110 §8.4
Related headers
Accept-Encoding
Which content encodings (compressions) the client accepts.
Content-Type
Declares the media type of the body.
Vary
Which request headers cause different cached variants of the response.
Content-Length
The size of the body in bytes.
Content-Disposition
Controls whether a resource is displayed inline or triggered as a download.