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:

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

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

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

Comparison of compression and optimization types

Compression on CDN (Gzip)Compression on CDN (Brotli)Compression at sourceImage compression
Image Stack
Optimize delivery of large files
What files are suitable forFiles larger than 128 B (format list)Files larger than 128 B (format list)Any filesImages .jpg and .pngFiles 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 uploaded to the CDN servers cache in 10 MB chunks as they are requested
Needed 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 compress using GZip and Brotli algorithms, the minimum file size for compression is 128 bytes.

If you want to use Brotli compression, then the resource must have the source shilding 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 maintained with both algorithms, then Brotli will be prioritized.

If the user's browser does not send headers listing supported compression formats in the request to the CDN, for example, Accept-Encoding: gzip, deflate, brThe content is 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 control panel go to CDNCDN resources.
  2. Open the CDN resource page → tab Settings.
  3. Open the card Content.
  4. Check the box GZip compression on CDN servers.
  5. Click Save. GZip compression will work within 30 minutes.

Compression at source

Principle of operation

Content is compressed at the source and gets to the CDN server 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 control panel go to CDNCDN resources.
  3. Open the CDN resource page → tab Settings.
  4. Open the card Content.
  5. Check the box Compressing files at the source.
  6. Click Save. The compression on the source will kick in within 30 minutes.