Gzip compression

Updated at:

After you enable Gzip compression, points of presence (PoPs) compress resources before delivering them to users. This reduces file sizes, improves transfer speeds, and lowers bandwidth consumption.

Background information

  • Gzip compression applies to origin server files that are 1 KB to 10 MB in size. Files smaller than 1 KB or larger than 10 MB are not compressed.

  • Gzip compression is supported for the following MIME types: 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/xml.

    Note: Enabling Gzip compression on already-compressed file types (such as PNG and JPG images, or MP4 videos) has no effect. For more information, see the usage notes below.

  • A client indicates that it supports Gzip-encoded content by including the Accept-Encoding: gzip request header.

  • A server indicates that a resource is Gzip-compressed by including the Content-Encoding: gzip response header.

Notes

  • Gzip compression changes the MD5 hash of static files. If your origin server uses MD5 validation, disable this feature.

  • If the origin server already compresses responses and includes the Content-Encoding response header, ApsaraVideo VOD does not apply additional compression.

  • Common image formats such as PNG, JPG, and JPEG, and video formats such as MP4, AVI, and WMV are already compressed, so Gzip compression provides no additional benefit for these files. To further reduce image file sizes, use the Image processing feature. To further reduce video file sizes, use the Transcoding feature.

Procedure

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > CDN Configuration > Domain Names.

  3. Find the target domain name and click Configure.

  4. In the left-side navigation pane, click Performance Optimization.

  5. In the Gzip Compression section, turn on the Gzip Compression switch.

    After you enable Gzip compression, you can compare the file received before and after enabling the feature. If the response header contains Content-Encoding: gzip, the file has been successfully compressed.

Related API operations

BatchSetVodDomainConfigs