Updated on 2025-07-25 GMT+08:00

Data Compression

Description

You can enable data compression for HTTP and HTTPS listeners to reduce the data size to be transferred, speed up transfers, and lower bandwidth usage.

When sending an HTTP or HTTPS request, the client includes Accept-Encoding:gzip,deflate,br,* in the request header, indicating that the client supports data compression and writes the compression algorithms it supports into the request header. Upon receiving the request, the server checks the Accept-Encoding header to determine which compression algorithms the client supports. Based on its own configuration and capabilities, the server selects one of the supported compression algorithms to compress the response body and includes Content-Encoding in the response header to notify the client that the response has been encrypted and the encryption algorithm used.

Compression is handled at every point in the communication chain (client, load balancer, and backend servers). For example, if a backend server compresses a response, ELB sends the response directly to the client without compressing the response again. ELB can only compress the response body whose status code is 200, 403, and 404.

Data Compression

Brotli and Gzip can compress the files in the following format: text/html, tex/xml, text/plain text/css, application/javascript, application/x-javascript, application/rss+xml, application/atom+xml, application/xml, and application/json.