Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Jetty/Feature/GZIP Compression"

< Jetty‎ | Feature
(New page: {{Jetty Feature | introduction = GZIP Compression can be used to reduce the amount of data being sent "over the wire". Compression is applied as a transport encoding. This can greatly impr...)
 
 
Line 5: Line 5:
 
===Static Content===
 
===Static Content===
  
The Jetty [[Jetty/Reference/DefaultServlet|Default Servlet]] can serve pre-compressed static content as a transport encoding and avoid the expense of on-the-fly compression. If the "gzip" init parameter is set to true, then Jetty will look for compressed static resources. So if a request for "foo.txt" is received and the file "foo.txt.gz" exists, then it will be served as "foo.txt" with a gzip transport encoding.
+
The Jetty [http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/servlet/DefaultServlet.html DefaultServlet] can serve pre-compressed static content as a transport encoding and avoid the expense of on-the-fly compression. If the "gzip" init parameter is set to true, then Jetty will look for compressed static resources. So if a request for "foo.txt" is received and the file "foo.txt.gz" exists, then it will be served as "foo.txt" with a gzip transport encoding.
  
 
===GzipFilter===
 
===GzipFilter===
  
The Jetty [[Jetty/Reference/GzipFilter|Gzip Filter]] is a compression filter that can be applied to almost any dynamic resource (servlet). It fixes many of the bugs in commonly available compression filters (eg handles all ways that content length may be set) and has been testing with Jetty continuations and suspending requests.
+
The Jetty [http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/servlets/GzipFilter.html GzipFilter] is a compression filter that can be applied to almost any dynamic resource (servlet). It fixes many of the bugs in commonly available compression filters (eg handles all ways that content length may be set) and has been testing with Jetty continuations and suspending requests.
  
 
Some user-agents may be excluded from compression, so as to avoid some common browser bugs (yes this means IE!).
 
Some user-agents may be excluded from compression, so as to avoid some common browser bugs (yes this means IE!).
 
| category = [[Category:Jetty Feature]]
 
| category = [[Category:Jetty Feature]]
 
}}
 
}}

Latest revision as of 14:03, 28 June 2010



Introduction

GZIP Compression can be used to reduce the amount of data being sent "over the wire". Compression is applied as a transport encoding. This can greatly improve webapplication performance, however it can also consume more CPU and some content (e.g. images) cannot be well compressed.

Feature

Static Content

The Jetty DefaultServlet can serve pre-compressed static content as a transport encoding and avoid the expense of on-the-fly compression. If the "gzip" init parameter is set to true, then Jetty will look for compressed static resources. So if a request for "foo.txt" is received and the file "foo.txt.gz" exists, then it will be served as "foo.txt" with a gzip transport encoding.

GzipFilter

The Jetty GzipFilter is a compression filter that can be applied to almost any dynamic resource (servlet). It fixes many of the bugs in commonly available compression filters (eg handles all ways that content length may be set) and has been testing with Jetty continuations and suspending requests.

Some user-agents may be excluded from compression, so as to avoid some common browser bugs (yes this means IE!).

Back to the top