Bug 50182 - Contributing back enhancements to CompressionFilter
Summary: Contributing back enhancements to CompressionFilter
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Examples (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement with 1 vote (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 15:45 UTC by David Becker
Modified: 2012-06-12 19:07 UTC (History)
1 user (show)



Attachments
Source code and example web.xml (8.78 KB, application/zip)
2010-10-29 15:45 UTC, David Becker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Becker 2010-10-29 15:45:38 UTC
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!
Comment 1 David Becker 2010-10-29 15:47:26 UTC
For records on my previous SSIFilter see: https://issues.apache.org/bugzilla/show_bug.cgi?id=33106
Comment 2 Mark Thomas 2012-06-12 19:07:59 UTC
Patch applied (with minor alterations) to 7.0.x and will be included in 7.0.28 onwards.