After intelligent compression is enabled, CDN edge nodes compress resources before the resources are returned to clients. Intelligent compression reduces file sizes, accelerates file distribution, and reduces bandwidth consumption.
- Both Gzip compression and Brotli compression are supported. Intelligent compression uses Gzip to compress files. For more information about Brotli compression, see Configure Brotli compression.
- Intelligent compression compresses files that are larger than 1 KB. Files smaller than 1 KB are not compressed.
- If a request carries the
Accept-Encoding: gziprequest header, the client expects the requested resources to be Gzip-compressed.
- If a response from the origin server carries the
Content-Encoding: gzipresponse header, the resources returned to the client are Gzip-compressed.
- Intelligent compression (Gzip compression) is compatible with all browsers. Brotli compression is not compatible with outdated browsers. You can query whether a browser supports Brotli compression as needed.
- When Alibaba Cloud CDN compresses static files, the MD5 values of the files are changed. If the origin server has MD5 verification enabled, disable intelligent compression and Brotli compression.
- If compression is enabled on the origin server and the response from the origin server
content_encoding, compression on CDN edge nodes does not take effect.
- If both Brotli compression and intelligent compression are enabled, and the
Accept-Encodingrequest header carries 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.
- Image files in common formats, including PNG, JPG, and JPEG, and video files in common formats, including MP4, AVI, and WMV, are already compressed. Intelligent compression and Brotli compression do not take effect for these files. We recommend that you disable intelligent compression and Brotli compression. If you want to further reduce image file sizes, you can use the image editing feature. If you want to further reduce video file sizes, you can use the video transcoding feature.
- 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 intelligent compression is enabled, you can compare the formats of a file before and after intelligent compression is enabled. If the file extension is .gzip, it indicates that the file is compressed.