Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 came across a problem with deflating HTML files larger than 8000 characters (documented in this question at stackoverflow). A straight HTML file larger than that causes the server to fail to deliver the contents resulting in the browser giving a 'server reset connection' message or something similar.

If I disable compression for the directory in question by removing the line containing 'SetOutputFilter DEFLATE' then the size limit is removed, but of course pages are not then compressed. This Apache document states that the default deflate buffer size is 8KB, which corresponds roughly to the size limit I am reaching, but adding the line 'DeflateBufferSize 20480' makes no difference to the size of page that can be compressed so I guess that is not the parameter I need to add or change.

Output generated by server side includes or AJAX calls is often far larger than 8000 characters and is compressed without problems. It is only with a straight HTML file that I am experiencing issues.

How can I increase the size of file that module deflate will compress?

EDIT:I did not find an answer beyond disabling mod_deflate, instead I put the HTML into another file and used a Server Side Include to display it. Not ideal, but it gets the job done and the page isn't part of the main project.

share|improve this question

According to the "module documentation": the DeflateBufferSize directive doesn't control the size of files which may be deflated, but instead the size of the fragments being deflated. The larger files (i.e. the AJAX calls you cite) are getting fragmented and compressed in fragments.

I'm guessing the error is due to something other than mod_deflate.

share|improve this answer
I agree about DeflateBufferSize but it was the only parameter that seemed even vaguely connected with the issue we are experiencing. Anyway, I have a workaround (using SSI) so it's not a critical issue anymore, I'd still be interested in seeing any possible causes. – blankabout Mar 8 '12 at 10:13
I could well be something other than mod_deflate, but taking out that line from the directory config allowed the page to be displayed so that led me to believe it was the problem. – blankabout Mar 8 '12 at 10:26

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.