Using the provided compression methods will result in the best performance and least maintenance.
Any client that makes requests to your deployment needs to define the Accept-Encoding header to opt into compression. Many clients (browsers like Chrome, Firefox and Safari) already do this out of the box. If you're making a request from another type of client make sure you use the
Accept-Encoding header to take advantage of compression.
As an example, this is how you ask the Network layer to compress using Brotli:
Nevertheless, some clients might not support it, so to use Gzip:
Assuming that the program requests deployment resources with the appropriate
Accept-Encoding header, the response will be compressed automatically.