Smart Compression
When smart compression is enabled, CDN automatically compresses your static files. This saves you a lot of bandwidth by reducing file size and speeds up file transfer. Smart compression includes gzip compression and Brotli compression. The performance of Brotli compression is 15% to 25% higher than that of gzip compression.
Precautions
- Smart compression applies to JS, HTML, CSS, XML, JSON, SHTML, and HTM files.
- Do not enable this function if MD5 verification has been configured for your origin server. When CDN compresses static files, the MD5 value is changed. As a result, the MD5 value of the compressed file is different from that of the file on the origin server.
- You cannot enable smart compression for domain names with special configurations.
- If both gzip and Brotli compression are enabled, Brotli compression is preferentially performed.
- General image files (such as PNG, JPG, and JPEG) and video files (such as MP4, AVI, and WMV) have already been compressed. Therefore, you do not need to enable smart compression (gzip or Brotli) for these files.
Procedure
- Log in to Huawei Cloud console. Choose .
The CDN console is displayed.
- In the navigation pane, choose .
- In the domain list, click the target domain name or click Configure in the Operation column.
- Click the Advanced Settings tab.
- Click Edit next to Smart Compression.
Figure 1 Smart compression
Table 1 Parameter description Parameter
Description
Status
Turn on or off the switch.
Compression Mode
Gzip or Brotli compression. If both are selected, Brotli compression is used.
Format
Enter file name extensions and multipurpose internet mail extensions (MIME).
- A single extension contains up to 50 characters and all extensions contain up to 2,000 characters. Separate extensions by semicolon (;).
- If this parameter is left empty, the default value .js;.html;.css;.xml;.json;.shtml;.htm is used.
- Select a compression method, specify formats of files to compress, and click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.