Jetty provides Gzip Filter to enable dynamic compression of contents like html, javascript, css etc. Just a servlet filter 'org.eclipse.jetty.servlets.GzipFilter' needs to be configured in web.xml to save bandwidth and speed up your website.

Tools and Technologies used in this article :

  1. Jetty 8

  2. Java Web Application

Note : Prior to Jetty 7, all versions were hosted in jetty.codehaus.org, so refer that site to get the correct package name ofGzipFilter class. For example, In Jetty 6 we need to use org.mortbay.servlet.GzipFilter.Download : 

Update web.xml

Add GzipFilter in the 'web.xml' file of your web application to be deployed in Jetty server.

 

Read More -->