Because the routing layer already implements two compression methods (Gzip and Brotli), we highly recommend leveraging them instead of making the code you are deploying to Now handle the compression.

This way, you are getting the maximum out of performance and do not have to worry about maintaining the code responsible for compressing your responses.

Any program that is requesting resources of any of your deployments needs to define the Accept-Encoding header in order for the compression mechanisms to kick in. Many clients (like browsers) already do this out of the box, but in the case that you are requesting resources using a different client, make sure to define the header.

As an example, this is how you ask the routing layer to compress using Brotli:

Accept-Encoding: br

If your client supports Brotli, we generally recommend using it over Gzip, because it usually performs much better.

Nevertheless, some clients might not support it, so you have to stick to Gzip:

Accept-Encoding: gzip

Assuming that the program requesting resources from any of your deployments defines the header like mentioned above, it is served compressed responses automatically.