Brotli Compression

Brotli is an innovative new compression algorithm introduced by Google and now broadly supported by modern web browsers. It is particularly effective for text-based file formats such as CSS, JavaScript, JSON, and XML.

We previously applied the Brotli algorithm to JavaScript files optimized by JavaScript Streaming. We are now expanding support to a broad set of other cached text-based assets such as CSS, JSON, XML, and more. This allows our platform to further reduce the size of larger text files and increase page load rendering performance as a result.

Typically we have seen between 14-39% improvement in file size reduction when compressed with Brotli when compared to standard gzip compression.

Note

Brotli compression only works if assets are sent via HTTPS, and if the property is in the PCI environment.

Which content types are compressed with Brotli?

  • text/richtext
  • text/plain
  • text/css
  • text/x-script
  • text/x-component
  • text/x-java-source
  • text/x-markdown
  • text/javascript
  • text/js
  • text/xml
  • application/javascript
  • application/xml
  • application/rss+xml
  • application/json
  • application/xhtml+xml
  • image/svg+xml

Which browsers support Brotli compression?

  • Google Chrome: version 50+
  • Microsoft Edge: version 15+
  • Mozilla Firefox: version 44+
  • Opera: version 38+
  • Safari: version 11+

For all requests, the Instart service detects if a browser supports Brotli, gzip, or no compression, and sends the correct object.

How do I tell that Brotli compression is working?

First, the object must be cached; you can tell by the presence of a x-instart-cache-id in the response.

If it is a cached object, the content-encoding value will be br in the response header. If you don't see this, check if the traffic is sent over HTTP rather than HTTPS. If so, Brotli compression will not work.

Can I enable/disable Brotli on my own?

You can.

If you have the v2 configuration with Performance & Delivery Rules:

Brotli compression will be one of the choices in the Actions list on the create and edit performance & delivery rule screens (Config > Performance & Delivery Rules > Create a New Performance & Delivery Rule):

For details, see Configuring Brotli Compression with the Performance & Delivery Rule Builder.

If you have the v1 configuration:

From the Property Overview page (Config > Properties & Domains > Property Overview), click on the Available Settings tab to display the configuration cards. Click on Brotli Compression to enable or disable it by default for the property and to create exceptions.

For details, see Configuring Properties and Domains in the Portal.