Very interesting tricks can be done with java servlet filters in security, performance, etc.
What are the best servlet filters out there?
Very interesting tricks can be done with java servlet filters in security, performance, etc.
What are the best servlet filters out there?
Hands down, the best, most insanely useful servlet filter out there is UrlRewriteFilter.
I contributed code to the Jython project that lets you write servlet filters in Jython.
WhitespaceFilter
to trim all whitespace from generated HTML. It can save over 50% of bandwidth, regardless of whether GZIP is used.
The top bandwith-saving combo would thus be Gzipping and trimming whitespace. If you're using a Filter
for GZIP as well instead of just configuring the servletcontainer to turn GZIP on (in for example Tomcat and clones by just doing <Connector compression="on">
in server.xml
), then you need to ensure that the whitespace filter runs before the GZIP filter.
This one impressed me, an implementation of the YUI CSS and Javascript compressor:
http://jango.wordpress.com/2009/04/27/js-minify-filter-in-java/