I found an article on On Java that shows how you can compress your servlet output before sending to browsers.
The really cool thing is though, it gives you a jar file you can drop in to your web-app and the settings to add to your web.xml.
Most browsers support this and where they don’t it falls back to non-compressed output.
So, you can add compression to your site within about 5 minutes of reading the article.
Excellent!
My home page used to be a 30k download, it’s now down to around 7.5k!
Neat!
The same thing for Python, Perl and PHP: http://www.mnot.net/cgi_buffer/
Hi,
I have written a servlet which also compresses JPEG pictures by reducing the quality automatically. In addition with a gzip filter your website gets this way optimum sizes :-))
http://www.printx.org/imageshrink/
(free download, sourcecode available)