I have a question on compression and encryption. Very often in the servlet,
we need to compress the output stream.
The code snippet below is one way of doing it.

String acceptEncoding = req.getHeader("Accept-Encoding");
 if      (acceptEncoding != null && acceptEncoding.indexOf("gzip") >= 0)
 {
         res.setHeader("Content-Encoding", "gzip");

         GZIPOutputStream gzOut = new
GZIPOutputStream(res.getOutputStream());

            // write to the gzip stream


         // close the streams
          gzOut.close();
         res.getOutputStream().close();
 }

The web server or the servlet container may also have encryption enabled.
Many of the encryption algorithms also do compression.
In SSL for example, compression is an option. In this situation, if we do
the compression as above, is it not true that we go through a wasted
compression cycle i.e one in the servlet code and the other in the web
server/servlet container level?

How do we detect and handle this situation?

Thanks,
Neela

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to