Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a client that sends requests to an apache server (note that the client is not a Web browser and the response is not a Web page). I would like to compress the output (probably with gzip), but I cannot modify the client to send a "Accept-Encoding: gzip" header.

So it is possible to force gzip compression of the response in apache even if no Accept-Encoding header was sent ?


share|improve this question
You could do it, but how can you be sure the client will actually understand it? After all, the whole point of the Accept-Encoding header is for the client to declare that it understands the encoding. – Michael Hampton Jul 26 '12 at 16:44
This is why I said the client was not a Web browser: i have a unique client of which I know the capabilities. – gou1 Jul 26 '12 at 17:09
up vote 0 down vote accepted

You can do this in several different ways: you could fake the request header, so gzip works normally, or you could force the DEFLATE output filter onto your content.

To add a request header, look here:

To force gzip output, look here:, which says:

Note: There is a environment variable force-gzip, set via SetEnv, which will ignore the accept-encoding setting of your browser and will send compressed output.

Plenty of options.

share|improve this answer
Many thanks, it worked great with force-gzip ! – gou1 Jul 26 '12 at 17:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.