Skip to main content
Gcore CDN supports Gzip and Brotli edge compression. When enabled, content is requested in uncompressed format from the origin, compressed and cached at the edge, and served to browsers that support compression — even when the origin server does not.

Compression methods

Gzip

The Gzip method reduces file size by 80% and up to 90%. The following MIME types can be compressed using Gzip:
  • application/dash+xml
  • application/javascript
  • application/json
  • application/x-javascript
  • application/xml
  • application/vnd.apple.mpegurl
  • application/xml+rss
  • application/wasm
  • text/css
  • text/html
  • text/javascript
  • text/plain
  • text/vtt
  • text/xml
  • image/svg+xml

Brotli

The Brotli method has a higher compression ratio compared to Gzip, and the minimum file size that can be compressed is 128 bytes. CDN supports Brotli compression only when Origin Shielding is activated. To activate Origin Shielding, enable it in the CDN resource settings under General. The following MIME types are configurable for Brotli compression:
  • application/javascript. Selected by default.
  • application/json. Selected by default.
  • application/x-javascript. Selected by default.
  • application/xml. Selected by default.
  • application/xml+rss. Selected by default.
  • text/css. Selected by default.
  • text/html. Selected by default. Cannot be deselected.
  • text/javascript. Selected by default.
  • text/plain. Selected by default.
  • text/xml. Selected by default.
  • application/vnd.ms-fontobject. Not added by default.
  • application/x-font-ttf. Not added by default.
  • image/x-icon. Not added by default.
  • image/svg+xml. Not added by default.
  • application/wasm. Not added by default.
Image formats (e.g., image/jpeg, image/png), video formats (e.g., video/mpeg), PDF, and other binary formats are already compressed. These formats provide little or no size reduction from Gzip or Brotli and may increase file size.

Features

  • A request must include the Accept-Encoding header to receive compressed content. This header indicates which compression methods the browser supports. Without this header, or if it does not include a gzip or br value, the response is delivered uncompressed.
  • When both Gzip and Brotli are enabled for a MIME type, CDN gives precedence to Brotli. If the browser does not support Brotli, CDN falls back to Gzip. When both options are active and a browser sends Accept-Encoding: gzip, br for a text/html document, the CDN returns Brotli-compressed content if Origin Shielding is enabled, and Gzip otherwise.
  • Content already cached before Gzip and Brotli are enabled is not re-compressed automatically. Purge the CDN resource cache after enabling the feature to serve compressed content from the edge.

Configuration guidelines

Review the following requirements and recommendations before configuring the options:
  • Both Gzip and Brotli compressions can be configured in the Resource Settings and Rules.
  • Purge the CDN resource cache after updating these options.
  • Brotli compression is only supported when Origin Shielding is enabled. Without active shielding, the Brotli option has no effect.
  • Gzip and Brotli compressions are not mutually exclusive and can be used together.
  • Gzip and Brotli compressions are mutually exclusive with Fetch Compressed and large files optimization within the same scope — they cannot be enabled together in the Resource Settings or within the same rule.
  • Gzip and Brotli compressions in Resource Settings can be combined with Fetch Compressed in Rules. In this case, edge nodes compress all requests, and specific requests are additionally compressed at the origin.
The reverse combination is not supported. When Fetch Compressed is enabled in Resource Settings, Gzip and Brotli compressions cannot be enabled in Rules.

Configuration steps

To configure Gzip and Brotli options via the Gcore Customer Portal: 1. Navigate to the CDN resources list and click the CDN resource to configure.
CDN resources list with a CDN resource row selected
2. In the sidebar, under the Content section, click GZip compression or Brotli compression.
Resource settings sidebar with Content section expanded showing GZip compression and Brotli compression items
3. Turn on the toggle for Enable GZip compression to enable the option. 4. Turn on the toggle for Enable Brotli compression to enable the option. In the Content types area, select the MIME types to compress. 5. Click Save changes.