users@glassfish.java.net

Double compression conundrum

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Dec 2008 10:02:20 PST

I have compression enabled for MIME types text/plain, text/html, ..., and this works fine for normal content.

But there is a problem delivering special content that is stored in database blobs. This content is already deflated to save space in the database, and it is delivered by a servlet filter by writing it directly on the output stream. If the content is not inflated first it gets compressed again, and so the browser ends up seeing the deflated data because it inflates it only once.

This can be fixed by inflating the content in the filter, but then the server will end up doing unnecessary work.

Why cannot glassfish look for "Content-Encoding" set to "deflate" or "gzip" to understand that although "ContentType" indicates compression is desired, this response must not be double compressed?
[Message sent by forum member 'hanafey' (hanafey)]

http://forums.java.net/jive/thread.jspa?messageID=322190