After you enable the intelligent compression feature, Alibaba Cloud Content Delivery Network (CDN) automatically compresses text files into Gzip files. This reduces file sizes, accelerates content delivery, and reduces bandwidth usage.
You can use intelligent compression or Brotli compression to compress files that are larger than 1,024 bytes. This reduces file sizes and accelerates content delivery. Brotli compression outperforms Gzip compression by about 15% to 25%.
- If a request includes the
Accept-Encoding: gziprequest header, the client expects the requested resources to be Gzip compressed.
- If a response from the origin server includes the
Content-Encoding: gzipresponse header, the resources returned to the client are Gzip compressed.
- If MD5 verification is configured for files on the origin server, do not enable intelligent
The intelligent compression feature changes the MD5 value of a file. After a file is compressed, the MD5 value of the file is no longer the same as that of the original file stored on the origin server.
- If compression is enabled on the origin server and the response includes
content_encoding, compression on CDN nodes does not take effect.
- If both Brotli compression and Gzip compression are enabled, and the
Accept-Encodingrequest header includes both
gzip, only Brotli compression takes effect.
- If both HTML optimization and Intelligent or Brotli compression are enabled, HTML optimization does not take effect. Alibaba Cloud CDN only compresses files.
- Gzip is supported by almost all browsers, whereas Brotli is supported only by certain browsers. You can click here to query whether a browser supports Gzip or Brotli.
- Log on to the Alibaba Cloud CDN console.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the domain name that you want to manage and click Manage in the Actions column of the domain name.
- In the management pane of the domain name, click Optimization.
- In the Intelligent Compression section, turn on Intelligent Compression and set the parameters.
After you enable intelligent compression, you can compare the sizes of a file before and after compression is performed. If the file size is reduced, it indicates that the file is compressed.