How to the Apache 2.2 deflate_module length limit be increased

apache-2.2mod-deflate

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.

Best Answer

According to the "module documentation":http://httpd.apache.org/docs/2.2/mod/mod_deflate.html 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.