You can do it with servlets. You have to check the request headers
to verify that the browser supports compressed pages (gzip) and then
use Java gzip capability to compress the data for the output stream.
Marty Hall's book on servlets and JSP has an example servlet that
does this.

I don't think it is possible to do this with a JSP page though a JSP
container could implement this feature.

The downsides to this approach is that the entire output stream has to
be built in memory and then compressed prior to sending to the client.
As a result the load on the server is higher. In a very busy site the
cost of using compression might actually make the site slower than if
the data was sent uncompressed.

Dave Bolt
ATSC/SPAWAR ASAT Team
Bolt's Law of Bandwidth - There is always plenty of network bandwidth, just
none for you.


-----Original Message-----
From: Gaurav Gehlot [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 22, 2000 8:09 PM
To: [EMAIL PROTECTED]
Subject: A Random Question


Hi,
  Is it possible to compress the web pages while sending it to the client
browser and then uncompress them on the client machine in order to reduce
the network traffic.

TIA,
gg

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to