How can I enable GZIP compression in Jetty?
I have a Jetty server which does not have compression enabled (I tested this here). How can I enable compression?
You have to enable the GzipFilter
to make Jetty return compressed content. Have a look here on how to do that: http://blog.max.berger.name/2010/01/jetty-7-gzip-filter.html
You can also use the gzip
init parameter to make Jetty search for compressed content. That means if the file file.txt
is requested, Jetty will watch for a file named file.txt.gz
and returns that.