Discussion:
Compression disabling on chunked response
Sachin Shetty
2018-10-05 07:08:15 UTC
Permalink
Hi,

I see this in the documentation:

Compression is disabled when:
* ...
* response header "Transfer-Encoding" contains "chunked" (Temporary
Workaround)
* ....

Is this still accurate?

I have tested a lot of responses from Server with compression enabled
in backend
and server sending chunked response, haproxy is compressing the stream
correctly.

What am I missing? I am trying to figure out in what cases could
haproxy not compress

a response from server.
Willy Tarreau
2018-10-08 17:30:55 UTC
Permalink
Hi Sasha,
Post by Sachin Shetty
Hi,
* ...
* response header "Transfer-Encoding" contains "chunked" (Temporary
Workaround)
* ....
Is this still accurate?
Ah no it is not. I'm surprised to see it still present, but the problem
with updating docs to reflect removal of limitations is always the same!
Post by Sachin Shetty
I have tested a lot of responses from Server with compression enabled
in backend
and server sending chunked response, haproxy is compressing the stream
correctly.
What am I missing? I am trying to figure out in what cases could
haproxy not compress a response from server.
It depends on a few factors like the presence of "cache-control: no-transform"
in the response, or certain user-agents in the request that are known to
indicate some affected by bugs. You can take a look at these functions for
an exhaustive list of exceptions :

select_compression_request_header()
select_compression_response_header()

Hoping this helps,
Willy
Sachin Shetty
2018-10-09 04:49:58 UTC
Permalink
Thanks Willy. Yes I can understand no-transform disabling it, I just wanted
to make sure that chunked response no longer disables compression. It
verifies my tests as well, thanks for confirming it.

Thanks
Sachin
Post by Willy Tarreau
Hi Sasha,
Post by Sachin Shetty
Hi,
* ...
* response header "Transfer-Encoding" contains "chunked" (Temporary
Workaround)
* ....
Is this still accurate?
Ah no it is not. I'm surprised to see it still present, but the problem
with updating docs to reflect removal of limitations is always the same!
Post by Sachin Shetty
I have tested a lot of responses from Server with compression enabled
in backend
and server sending chunked response, haproxy is compressing the stream
correctly.
What am I missing? I am trying to figure out in what cases could
haproxy not compress a response from server.
It depends on a few factors like the presence of "cache-control: no-transform"
in the response, or certain user-agents in the request that are known to
indicate some affected by bugs. You can take a look at these functions for
select_compression_request_header()
select_compression_response_header()
Hoping this helps,
Willy
Loading...