Created attachment 26227 [details] Source code and example web.xml Years ago I contributed an enhancement to convert the SSIServlet into a filter (java/org/apache/catalina/ssi/SSIFilter.java). Now I'm back to offer up some enhancements to the CompressionFilter example (webapps/examples/WEB-INF/classes/compressionFilters). I've found (as have others) that the connector compression is flaky and unreliable, so I turned to the CompressionFilter example, but found it to be badly lacking in functionality. No doubt owing to its status as an example project. I've made a bunch of enhancements to it and I feel it's worth of being moved out of examples now. You may even want to deprecate the connector compression in favor of this - or at least roll the two together. In my own webapp (and the attached zip) I've renamed it to GZipFilter and it lives in my own internal package structure, but please move it back into an org.apache package structure and rename it as you see fit. The enhancements I've made are: * It now supports specifying which mime types are compressible. * It now supports a variable sized buffer, which can be used to avoid chunking on small files. * The compression threshold and all other settings are configurable in web.xml. * Miscellaneous bug fixes. If you adopt these enhancements, please credit David Becker with no email, same as on the SSIServlet. Enjoy!
For records on my previous SSIFilter see: https://issues.apache.org/bugzilla/show_bug.cgi?id=33106
Patch applied (with minor alterations) to 7.0.x and will be included in 7.0.28 onwards.