Skip to main content
File compression
Last update:

File compression

File compression helps reduce the load on the content source and speed up the delivery of content to end users. You can use one of two free types of compression:

Images of .jpg and .png formats are not processed during compression on CDN servers, and it is not recommended to process them during compression on the source. To compress such images, you can connect Image Stack paid image compression.

If you want faster downloads without compression, optimize the delivery of large files.

Not all compression and optimization types can be used together. To see their characteristics and compatibility, see the Compression and Optimization Comparison table.

Comparison of compression and optimization types

Compression on CDN (Gzip)Compression on CDN (Brotli)Compression at sourceImage compressionOptimize delivery of large files
What files are suitable forFiles larger than 128 B (list of formats)Files larger than 128 B (list of formats)Any files.jpg and .png imagesFiles larger than 10 MB
How it worksContent is compressed using the Gzip algorithm on CDN serversContent is compressed using Brotli algorithm on the shilding serverContent is compressed using the Gzip algorithm on the source serverImages are compressed according to the specified parameters on a special Image Stack server, then sent to the cache of CDN-serversFiles larger than 10 MB are downloaded to the CDN servers cache in 10 MB chunks as requests are made
Need a source shildingRecommended
Compatibility
  • CDN compression (Brotli);
  • Image Stack image compression
  • CDN compression (Gzip);
  • Image Stack image compression
  • Optimizing the delivery of large files;
  • CDN compression (Gzip, Brotli)
  • Image Stack image compression

Compression on CDN servers

Principle of operation

Content on the source is stored uncompressed and compressed when it hits the CDN server cache.

You can enable GZip and Brotli compression, the minimum file size for compression is 128 bytes.

If you want to use Brotli compression, source shilding must be enabled for the resource, since the compression is performed on the shilding server.

You can use one of the algorithms or both. If both algorithms are enabled and supported in the browser, and the file format is supported by both algorithms, Brotli will be prioritized.

If in a request to the CDN the user's browser does not send headers listing supported compression formats, such as Accept-Encoding: gzip, deflate, br, the content is delivered uncompressed.

List of supported formats for compression

GZipBrotli
application/javascript
application/json
application/x-javascript
application/xml
application/xml+rss
application/vnd.ms-fontobject
application/x-font-ttf
text/css
text/html
text/javascript
text/plain
text/xml
image/svg+xml
image/x-icon

Enable compression on CDN servers

  1. In the Control Panel, on the top menu, click Products and select CDN.
  2. Open the CDN resource page → Settings tab.
  3. Open the Content card.
  4. Check the GZip Compression on CDN servers checkbox.
  5. Click Save. GZip compression will work within 30 minutes.

Compression at source

Principle of operation

Content is compressed at the source and enters the CDN server's cache in an already compressed form. This helps to reduce the time of content delivery, as CDN servers do not waste time processing it.

Enable compression on the source

  1. Make sure the source server is configured to compress files using the Gzip algorithm. If compression is not configured or is not using a different algorithm, uncompressed content will always be output.
  2. In the Control Panel, on the top menu, click Products and select CDN.
  3. Open the CDN resource page → Settings tab.
  4. Open the Content card.
  5. Check the Compress files on source checkbox.
  6. Click Save. Compression on the source will work for 30 minutes.