private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development
GzipHandler is a compression handler that you can apply to any dynamic resource (servlet).
It fixes many of the bugs in commonly available compression filters: it works with asynchronous servlets; it handles all ways to set content length.
It has been tested with Jetty continuations and suspending requests.
Some user-agents might be excluded from compression to avoid common browser bugs (yes, this means IE!).
GzipHandler can be added to the entire server by enabling the
It may also be added to individual contexts in a context xml file.
Jetty 9 only compresses using GZip. Using deflate HTTP compression is not supported and will not function.
GzipHandler will gzip the content of a response if:
Compressing the content can greatly improve the network bandwidth usage, but at the cost of memory and CPU cycles. The DefaultServlet is capable of serving pre-compressed static content, which saves memory and CPU.
GzipHandler installs an output interceptor which passes through to the
If the content served by
DefaultServlet is already compressed, the
GzipHandler does nothing; if it is not compressed, the content is compressed on-the-fly.
Automatic precompression by the
DefaultServletcan be configured. Read more about the
GETrequests are compressed.
String.startsWith(String)comparison to check if the path matches. If it does match then there is no compression. To match subpaths use excludePathPatterns instead.