users@jersey.java.net

Support for Content-Encoding, Acccept-Encoding "gzip" filters

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 05 Sep 2008 17:51:51 +0200

Hi,

I have just added client and server-side filters to support Content-
Encoding and Accept-Encoding for values of "gzip". I did not want to
support "Transfer-Encoding" at the moment, the reason is i am not sure
if it will interfere with the containers, which are better placed to
support this.

Probably the best way to show this is to look at a unit test [1].

This works for entities sent from the client to the server and for
entities sent from the server to the client.

A client or service can override the behavior by adding a "Content-
Encoding" header of "identity" such that entities will not be
compressed.

A client can configure request entity compression such that entities
are only compressed if a "Content-Encoding" header is present with a
value of "gzip".

The client will always send an "Accept-Encoding" of "gzip" and the
server will always compress if gzip is acceptable.

I suppose this could be improved to work in the presence of multiple
layers of Content-Encoding but that is quite a rare thing.

Paul.

https://jersey.dev.java.net/source/browse/*checkout*/jersey/trunk/jersey/jersey-tests/src/test/java/com/sun/jersey/impl/container/grizzly/GZIPContentEncodingTest.java