To compress static text files, you can enable the Brotli compression feature to reduce the size of the transmitted content and accelerate delivery. This topic describes how to enable the Brotli compression feature.
Brotli is a new open source compression algorithm. After you enable Brotli compression, Dynamic Content for CDN (DCDN) nodes compress text files such as HTML, JS, and CSS files when DCDN returns the requested resources. Brotli compression is 15% to 25% more efficient than gzip compression.
- If a request contains the
Accept-Encoding: brheader, this indicates that the requested resources are required to be compressed by using Brotli.
- If a response from DCDN includes the
Content-Encoding: brheader, this indicates that Brotli is used to compress the requested resources.
- If both Brotli compression and gzip compression are enabled, and the
Accept-Encodingrequest header contains
gzip, Brotli compression prevails over gzip compression.
- If compression is enabled on an origin server and the response contains the
Content-Encodingheader, Brotli compression is not supported.
- Log on to the DCDN 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 Configure in the Actions column.
- On the details page of the specified domain name, click Optimization in the left-side navigation pane.
- In the Brotli Compression section, turn on Brotli Compression.