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:
- compression on CDN servers using the GZip and Brotli algorithms;
- compression at source.
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 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, br
The content is uncompressed.
List of supported formats for compression
Enable compression on CDN servers
Enable GZip compression
Enable Brotli compression
- In control panel go to CDN → CDN resources.
- Open the CDN resource page → tab Settings.
- Open the card Content.
- Check the box GZip compression on CDN servers.
- Click Save. GZip compression will work within 30 minutes.
- Make sure you turn on source shilding.
- In control panel go to CDN → CDN resources.
- Open the CDN resource page → tab Settings.
- Open the card Content.
- Check the box Brotli compression.
- Click Save. Brotli compression will kick in 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
- 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.
- In control panel go to CDN → CDN resources.
- Open the CDN resource page → tab Settings.
- Open the card Content.
- Check the box Compressing files at the source.
- Click Save. The compression on the source will kick in within 30 minutes.