As prescribed by Yahoo!, gzip\'ng files would make your websites load faster. The problem? I don\'t know how :p
Jetty will look for gzip'd versions of static files, as well as it has a GzipFilter for dynamic content.
You could probably pull the GzipFilter over into Tomcat if you wanted more control over compression than just Tomcat's connector-level compression...
http://docs.codehaus.org/display/JETTY/GZIP+Compression
Edit your httpd.conf file.
Add this line to load the module:
LoadModule deflate_module modules/mod_deflate.so
Add these lines to actually compress the output:
AddOutputFilterByType DEFLATE text/css text/html application/x-javascript application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Seeing how most answers here are almost 5 years old, here's some very current and up to date example references.
For example server configs that enable gzip/deflate type compression for iis
, lighthttpd
, nginx
, and even node
see: https://github.com/h5bp/server-configs
For a very good current implementation of Apache mod_deflate
see
https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L156