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 Network layer to compress using Brotli:
Nevertheless, some clients might not support it, so you have to stick to Gzip:
Assuming that the program requesting resources from any of your deployments defines the header like mentioned above, it is served compressed responses automatically.