The smart compression feature enables Dynamic Route for CDN (DCDN) to implement gzip compression on static files. The gzip compression feature helps you reduce the size of the transferred files and accelerate content delivery. This topic describes how to enable the smart compression feature.

Background information

  • Intelligent compression supports the following formats: text/html, text/xml, text/plain, text/css, application/javascript, application/x-javascript, application/rss+xml, text/javascript, image/tiff, image/svg+xml, application/json, and application/xmltext.
  • If a request from a client includes the Accept-Encoding: gzip request header, the client expects the requested content to be gzip compressed.
  • If a response from DCDN includes the Content-Encoding: gzip response header, the returned content is gzip compressed.
Notice
  • If MD5 verification is configured for files on origin servers, do not enable the smart compression feature. After static files are compressed, the MD5 hash values of the compressed files are different from those of the files on the origin servers. As a result, the MD5 validation fails due to the inconsistency.
  • DCDN compresses files on origin servers only when the file size exceeds 1,024 bytes.
  • Internet Explorer 6 is not fully compatible with gzip. If your website has access requests from Internet Explorer 6, we recommend that you disable the smart compression feature.

Procedure

  1. Log on to the DCDN console.
  2. In the left-side navigation pane, click Domain Names.
  3. On the Domain Names page, find the domain name that you want to manage, and click Configure in the Actions column.
  4. In the left-side navigation pane on the details page of the specified domain, click Optimization.
  5. In the File Compression section, turn on File Compression.
    Configure smart compression