The HTTP headers Content-encoding is used to compress the media type. It informers the server which encoding the user will supported. It sends the information to the Accept-encoding. The server selects any one of the proposals, uses it and informs the client of its choice with the Content-Encoding response header.
Syntax:
Content-Encoding: gzip | compress | deflate | br| identity
Note: Multiple algorithms can also be applied.
Directives:
- gzip: It uses Lempel-Ziv coding (LZ77), with a 32-bit CRC format. It is the original format of UNIX gzip program.
- compress: It uses Lempel-Ziv-Welch (LZW) algorithm. Due to patent issue, many modern browsers don’t support this type of content-encoding.
- deflate: This format uses zlib structure with deflate compression algorithm.
- br: It is a compression format using the Brotli algorithm.
- identity: It is used to indicate that there is no compression.
You can check how good your Accept-Encoding and Content-Encoding is working on this site.
Example:
Single Compression:
Content-Encoding: gzip
Content-Encoding: compress
Multiple Compression:
Content-Encoding: gzip, compress
To check the Content-Encoding in action go to Inspect Element -> Network check the request header for Content-Encoding like below, Content-Encoding is highlighted you can see.

Supported Browsers: The browsers compatible with HTTP headers Content-Encoding are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Safari
- Opera
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
23 Oct, 2019
Like Article
Save Article