Hi Dmitry,

On Thu, Nov 22, 2012 at 08:03:26PM +0400, Dmitry Sivachenko wrote:
> Hello!
> 
> I was reading docs about HTTP compression support in -dev13 and it is a bit
> unclear to me how it works.
> 
> Imagine I have:
> compression algo gzip
> compression type text/html text/javascript text/xml text/plain
> 
> in defaults section.
> 
> What will haproxy do if:
> 1) backend server does NOT support compression;

Haproxy will compress the matching responses.

> 2) backend server does support compression;

You have two possibilities :
  - either you just have the lines above, and the server will see
    the Accept-Encoding header from the client and will compress
    the response ; in this case, haproxy will see the compressed
    response and will not compress again ;

  - or you also have a "compression offload" line. In this case,
    haproxy will remove the "Accept-Encoding" header before passing
    the request to the server. The server will then *not* compress,
    and haproxy will compress the response. This is what I'm doing
    at home because the compressing server is bogus and sometimes
    emits wrong chunked encoded data!

> 3) backend server does support compression and there is no these two
> compression* lines in haproxy config.

Then haproxy's normal behaviour remains unchanged, the server compresses
if it wants to and haproxy transfers the response unmodified.

> I think documentation needs to clarify things a bit.

Possibly, however I don't know what to clarify nor how, it's always
difficult to guess how people will understand a doc :-(

Could you please propose some changes ? I would be happy to improve
the doc if it helps people understand it.

Thanks!
Willy


Reply via email to