Oct 03, 2019 03:30 PM|bruce (sqlwork.com)|LINK
you seem to have absolutely no understanding of the http protocol and its use of compression.
in http 1, payload compression is optional feature added to the protocol. if the payload is compressed , the encoding header is set to let the client know the compression type. The client first sends an accept header with the compressions algorithms supported.
if the server supported one of the requested algorithms, it responds with a compression payload.
with http1, the web server needs to implement payload compression support. as compression is not part of the protocol, but an agreement between services using the protocol, the client library also needs to know about compression. older libraries have no
support (you need to add the code yourself), new libraries have it builtin. in your sample code for http 1, you are setting the accept headers, but there is no guarantee the server supports them or responds with compressed content.
in http 2 payload compression is no longer required. the protocol has compression built in. so any library that supports http 2, will support http 2 compression (which is wire compression, not payload). your web server must still support http 1, because
many clients do not yet support http 2, and will make http 1 requests. as you are using client code, there is no guarantee that the server supports http 2, and it will fall back to http 1.