Compression Filter

2004-03-09 Thread Shahak.Nagiel
I'm trying to implement a compression filter on the HTTP response similar to that 
discussed in http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=1.

When requesting straight JSP's, it works fine, but any Struts .dos do not work.  
Specifically, it appears the compression filter itself functions normally, but the 
browser responds with an empty page.  (The source code, cryptically enough, does 
include htmlbody/body/html, but I suspect that's being defaulted somewhere.)

I've tried:

- Configuring the filter to handle *.do as a url-pattern, instead of the servlet-name 
action.
- Commenting out the compression code entirely, leaving only
GZIPResponseWrapper wrappedResponse = new GZIPResponseWrapper(res);
  chain.doFilter(req, wrappedResponse);
- Executing the compression on a subclass of ActionServlet (after the super's 
doGet/doPost are called).

...but still the same results.

We are running Struts on Sybase EAServer 4.2, by the way.

Thanks in advance,

Shahak Nagiel
Software Engineer
Northrop Grumman Mission Systems

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Compression Filter

2004-03-09 Thread Hookom, Jacob
Check your server logs for exceptions that say the response has already been
committed.  We had a programmer try to create a compression filter based on
the source from one of those articles and it did not work on our production
servers.  Worth a look...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 09, 2004 2:56 PM
To: [EMAIL PROTECTED]
Subject: Compression Filter

I'm trying to implement a compression filter on the HTTP response similar to
that discussed in
http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=1.

When requesting straight JSP's, it works fine, but any Struts .dos do not
work.  Specifically, it appears the compression filter itself functions
normally, but the browser responds with an empty page.  (The source code,
cryptically enough, does include htmlbody/body/html, but I suspect
that's being defaulted somewhere.)

I've tried:

- Configuring the filter to handle *.do as a url-pattern, instead of the
servlet-name action.
- Commenting out the compression code entirely, leaving only
GZIPResponseWrapper wrappedResponse = new GZIPResponseWrapper(res);
  chain.doFilter(req, wrappedResponse);
- Executing the compression on a subclass of ActionServlet (after the
super's doGet/doPost are called).

...but still the same results.

We are running Struts on Sybase EAServer 4.2, by the way.

Thanks in advance,

Shahak Nagiel
Software Engineer
Northrop Grumman Mission Systems

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Compression Filter

2004-03-09 Thread Shahak.Nagiel
Indeed, I got the exceptions you mentioned.  Presumably, this is because requests for 
.dos ultimately either forward or redirect to JSP's, and, I believe, either one will 
flush the response buffer and hence commit the response.

So, does this mean there's no way to enable a filter-based compression with Struts?


-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 09, 2004 4:04 PM
To: Struts Users Mailing List
Subject: RE: Compression Filter


Check your server logs for exceptions that say the response has already been
committed.  We had a programmer try to create a compression filter based on
the source from one of those articles and it did not work on our production
servers.  Worth a look...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 09, 2004 2:56 PM
To: [EMAIL PROTECTED]
Subject: Compression Filter

I'm trying to implement a compression filter on the HTTP response similar to
that discussed in
http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=1.

When requesting straight JSP's, it works fine, but any Struts .dos do not
work.  Specifically, it appears the compression filter itself functions
normally, but the browser responds with an empty page.  (The source code,
cryptically enough, does include htmlbody/body/html, but I suspect
that's being defaulted somewhere.)

I've tried:

- Configuring the filter to handle *.do as a url-pattern, instead of the
servlet-name action.
- Commenting out the compression code entirely, leaving only
GZIPResponseWrapper wrappedResponse = new GZIPResponseWrapper(res);
  chain.doFilter(req, wrappedResponse);
- Executing the compression on a subclass of ActionServlet (after the
super's doGet/doPost are called).

...but still the same results.

We are running Struts on Sybase EAServer 4.2, by the way.

Thanks in advance,

Shahak Nagiel
Software Engineer
Northrop Grumman Mission Systems

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Compression Filter

2004-03-09 Thread Hookom, Jacob
No, the problem is that the implementation you are using is the same as the
one our programmer tried to use.  In the Servlet spec, you can write to
response 2 different ways.  Depending on the application server you are
using, this can be through the writer or stream, but not both.  This is the
problem you are seeing.

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletResponse.html#get
OutputStream()

Have your ResponseWrapper instead write to an object like this.  Also, in
your filter, before you wrap, check the instanceof the response to make sure
you don't double bag the response (servlet 2.3 spec).

public class ResponseToken 
{
private byte[] content;
private transient ByteArrayOutputStream outputStream = new
ByteArrayOutputStream();

public ResponseToken()
{
}

public ResponseToken(String content)
{
this.content = content.getBytes();
}

public void commit()
{
if (this.content == null)
{
try
{
this.outputStream.close();
}
catch (IOException e)
{
}
this.content = this.outputStream.toByteArray();
}
}

public OutputStream getOutputStream()
{
return outputStream;
}

public void setOutputStream(ByteArrayOutputStream outputStream)
{
this.outputStream = outputStream;
}

public void readExternal(ObjectInput input)
throws IOException, ClassNotFoundException
{
this.content = (byte[]) input.readObject();
}

public void writeExternal(ObjectOutput output) throws IOException
{
this.commit();

output.writeObject(this.content);
}

public void writeToResponse(HttpServletResponse response)
throws ServletException, IOException
{
this.commit();

OutputStream os = new
BufferedOutputStream(response.getOutputStream());
os.write(this.content);
os.flush();
}
}

Jacob Hookom
Senior Analyst/Programmer
McKesson Medical-Surgical
Golden Valley, Minnesota
http://www.mckesson.com

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 09, 2004 3:24 PM
To: [EMAIL PROTECTED]
Subject: RE: Compression Filter

Indeed, I got the exceptions you mentioned.  Presumably, this is because
requests for .dos ultimately either forward or redirect to JSP's, and, I
believe, either one will flush the response buffer and hence commit the
response.

So, does this mean there's no way to enable a filter-based compression with
Struts?


-Original Message-
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 09, 2004 4:04 PM
To: Struts Users Mailing List
Subject: RE: Compression Filter


Check your server logs for exceptions that say the response has already been
committed.  We had a programmer try to create a compression filter based on
the source from one of those articles and it did not work on our production
servers.  Worth a look...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 09, 2004 2:56 PM
To: [EMAIL PROTECTED]
Subject: Compression Filter

I'm trying to implement a compression filter on the HTTP response similar to
that discussed in
http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html?page=1.

When requesting straight JSP's, it works fine, but any Struts .dos do not
work.  Specifically, it appears the compression filter itself functions
normally, but the browser responds with an empty page.  (The source code,
cryptically enough, does include htmlbody/body/html, but I suspect
that's being defaulted somewhere.)

I've tried:

- Configuring the filter to handle *.do as a url-pattern, instead of the
servlet-name action.
- Commenting out the compression code entirely, leaving only
GZIPResponseWrapper wrappedResponse = new GZIPResponseWrapper(res);
  chain.doFilter(req, wrappedResponse);
- Executing the compression on a subclass of ActionServlet (after the
super's doGet/doPost are called).

...but still the same results.

We are running Struts on Sybase EAServer 4.2, by the way.

Thanks in advance,

Shahak Nagiel
Software Engineer
Northrop Grumman Mission Systems

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED

Re: Tomcat 4 Compression Filter

2004-02-26 Thread Niall Pemberton
Thanks Navjot.

Thats another option I hadn't thought of.

Niall

- Original Message - 
From: Navjot Singh [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 5:10 AM
Subject: RE: Tomcat 4 Compression Filter


 put apache in front of tomcat and install mod_gzip with apache.
 it will do almost everything you can wish for?
 
 -Original Message-
 From: Niall Pemberton [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 25, 2004 5:43 PM
 To: Struts User Jakarta
 Subject: Tomcat 4 Compression Filter
 
 
 There is a CompressionFilter class shipped with with Tomcat which 
 compresses the ServletResponse that I'm considering using (we have 
 some remote offices which have slow links):
 
 http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/exampl
 es/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=1.
 8view=auto
 
 It looks OK to me and seems to work fine when I plug it into my app.
 
 I'm a bit concerned that its only an example class rather than 
 standard feature of Tomcat. 
 
 Has anyone used this in a 'live' environment and if so are there 
 any issues or with it or recommendations?
 
 Does anyone have any alternatives that they have deployed?
 
 Niall
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 4 Compression Filter

2004-02-25 Thread Niall Pemberton
There is a CompressionFilter class shipped with with Tomcat which compresses the 
ServletResponse that I'm considering using (we have some remote offices which have 
slow links):

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=1.8view=auto

It looks OK to me and seems to work fine when I plug it into my app.

I'm a bit concerned that its only an example class rather than standard feature of 
Tomcat. 

Has anyone used this in a 'live' environment and if so are there any issues or with it 
or recommendations?

Does anyone have any alternatives that they have deployed?

Niall

RE: Tomcat 4 Compression Filter

2004-02-25 Thread Jerry Jalenak
I've also been playing around with this with mixed results.  I've been
looking for some doc on the filter mainly to better understand the
'compressThreshold' setting.  Does anyone have any doc for this thing?

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


 -Original Message-
 From: Niall Pemberton [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 25, 2004 6:13 AM
 To: Struts User Jakarta
 Subject: Tomcat 4 Compression Filter
 
 
 There is a CompressionFilter class shipped with with Tomcat 
 which compresses the ServletResponse that I'm considering 
 using (we have some remote offices which have slow links):
 
 http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
 xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
 ava?rev=1.8view=auto
 
 It looks OK to me and seems to work fine when I plug it into my app.
 
 I'm a bit concerned that its only an example class rather 
 than standard feature of Tomcat. 
 
 Has anyone used this in a 'live' environment and if so are 
 there any issues or with it or recommendations?
 
 Does anyone have any alternatives that they have deployed?
 
 Niall
 

This transmission (and any information attached to it) may be confidential and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 4 Compression Filter

2004-02-25 Thread Kris Schneider
Essentially, the compressionThreshold filter init param is a buffer size for
CompressionResponseStream. If it's 0, then compression is turned off (this is
handled by the filter, not the stream). Otherwise, it's the max of 128
(hard-coded min) and whatever is set in web.xml. The stream works by buffering
up bytes and periodically flushing them to a GZIPOutputStream that wraps the
response's ouput stream.

Quoting Jerry Jalenak [EMAIL PROTECTED]:

 I've also been playing around with this with mixed results.  I've been
 looking for some doc on the filter mainly to better understand the
 'compressThreshold' setting.  Does anyone have any doc for this thing?
 
 Jerry Jalenak
 Development Manager, Web Publishing
 LabOne, Inc.
 10101 Renner Blvd.
 Lenexa, KS  66219
 (913) 577-1496
 
 [EMAIL PROTECTED]
 
 
  -Original Message-
  From: Niall Pemberton [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, February 25, 2004 6:13 AM
  To: Struts User Jakarta
  Subject: Tomcat 4 Compression Filter
  
  
  There is a CompressionFilter class shipped with with Tomcat 
  which compresses the ServletResponse that I'm considering 
  using (we have some remote offices which have slow links):
  
  http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
  xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
  ava?rev=1.8view=auto
  
  It looks OK to me and seems to work fine when I plug it into my app.
  
  I'm a bit concerned that its only an example class rather 
  than standard feature of Tomcat. 
  
  Has anyone used this in a 'live' environment and if so are 
  there any issues or with it or recommendations?
  
  Does anyone have any alternatives that they have deployed?
  
  Niall

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 4 Compression Filter

2004-02-25 Thread Jerry Jalenak
Kris - Thanks.  So what's a reasonable setting?  The example has the
threshold set to 10; is this OK for most web apps? 



Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


 -Original Message-
 From: Kris Schneider [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 25, 2004 9:42 AM
 To: Struts Users Mailing List
 Subject: RE: Tomcat 4 Compression Filter
 
 
 Essentially, the compressionThreshold filter init param is 
 a buffer size for
 CompressionResponseStream. If it's 0, then compression is 
 turned off (this is
 handled by the filter, not the stream). Otherwise, it's the max of 128
 (hard-coded min) and whatever is set in web.xml. The stream 
 works by buffering
 up bytes and periodically flushing them to a GZIPOutputStream 
 that wraps the
 response's ouput stream.
 
 Quoting Jerry Jalenak [EMAIL PROTECTED]:
 
  I've also been playing around with this with mixed results. 
  I've been
  looking for some doc on the filter mainly to better understand the
  'compressThreshold' setting.  Does anyone have any doc for 
 this thing?
  
  Jerry Jalenak
  Development Manager, Web Publishing
  LabOne, Inc.
  10101 Renner Blvd.
  Lenexa, KS  66219
  (913) 577-1496
  
  [EMAIL PROTECTED]
  
  
   -Original Message-
   From: Niall Pemberton [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, February 25, 2004 6:13 AM
   To: Struts User Jakarta
   Subject: Tomcat 4 Compression Filter
   
   
   There is a CompressionFilter class shipped with with Tomcat 
   which compresses the ServletResponse that I'm considering 
   using (we have some remote offices which have slow links):
   
   http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
   xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
   ava?rev=1.8view=auto
   
   It looks OK to me and seems to work fine when I plug it 
 into my app.
   
   I'm a bit concerned that its only an example class rather 
   than standard feature of Tomcat. 
   
   Has anyone used this in a 'live' environment and if so are 
   there any issues or with it or recommendations?
   
   Does anyone have any alternatives that they have deployed?
   
   Niall
 
 -- 
 Kris Schneider mailto:[EMAIL PROTECTED]
 D.O.Tech   http://www.dotech.com/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

This transmission (and any information attached to it) may be confidential and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 4 Compression Filter

2004-02-25 Thread Niall Pemberton
...its also what its name implies a threshold - if the reponse doesn't
exceed the threshold (in bytes) it writes it out normally - uncompressed.

- Original Message - 
From: Kris Schneider [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 3:41 PM
Subject: RE: Tomcat 4 Compression Filter


 Essentially, the compressionThreshold filter init param is a buffer size
for
 CompressionResponseStream. If it's 0, then compression is turned off (this
is
 handled by the filter, not the stream). Otherwise, it's the max of 128
 (hard-coded min) and whatever is set in web.xml. The stream works by
buffering
 up bytes and periodically flushing them to a GZIPOutputStream that wraps
the
 response's ouput stream.

 Quoting Jerry Jalenak [EMAIL PROTECTED]:

  I've also been playing around with this with mixed results.  I've been
  looking for some doc on the filter mainly to better understand the
  'compressThreshold' setting.  Does anyone have any doc for this thing?
 
  Jerry Jalenak
  Development Manager, Web Publishing
  LabOne, Inc.
  10101 Renner Blvd.
  Lenexa, KS  66219
  (913) 577-1496
 
  [EMAIL PROTECTED]
 
 
   -Original Message-
   From: Niall Pemberton [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, February 25, 2004 6:13 AM
   To: Struts User Jakarta
   Subject: Tomcat 4 Compression Filter
  
  
   There is a CompressionFilter class shipped with with Tomcat
   which compresses the ServletResponse that I'm considering
   using (we have some remote offices which have slow links):
  
   http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
   xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
   ava?rev=1.8view=auto
  
   It looks OK to me and seems to work fine when I plug it into my app.
  
   I'm a bit concerned that its only an example class rather
   than standard feature of Tomcat.
  
   Has anyone used this in a 'live' environment and if so are
   there any issues or with it or recommendations?
  
   Does anyone have any alternatives that they have deployed?
  
   Niall

 -- 
 Kris Schneider mailto:[EMAIL PROTECTED]
 D.O.Tech   http://www.dotech.com/

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 4 Compression Filter

2004-02-25 Thread Niall Pemberton
If you set it less than 10, it will get re-set to 128 (unless its zero)

- Original Message - 
From: Jerry Jalenak [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 3:57 PM
Subject: RE: Tomcat 4 Compression Filter


 Kris - Thanks.  So what's a reasonable setting?  The example has the
 threshold set to 10; is this OK for most web apps?



 Jerry Jalenak
 Development Manager, Web Publishing
 LabOne, Inc.
 10101 Renner Blvd.
 Lenexa, KS  66219
 (913) 577-1496

 [EMAIL PROTECTED]


  -Original Message-
  From: Kris Schneider [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, February 25, 2004 9:42 AM
  To: Struts Users Mailing List
  Subject: RE: Tomcat 4 Compression Filter
 
 
  Essentially, the compressionThreshold filter init param is
  a buffer size for
  CompressionResponseStream. If it's 0, then compression is
  turned off (this is
  handled by the filter, not the stream). Otherwise, it's the max of 128
  (hard-coded min) and whatever is set in web.xml. The stream
  works by buffering
  up bytes and periodically flushing them to a GZIPOutputStream
  that wraps the
  response's ouput stream.
 
  Quoting Jerry Jalenak [EMAIL PROTECTED]:
 
   I've also been playing around with this with mixed results.
   I've been
   looking for some doc on the filter mainly to better understand the
   'compressThreshold' setting.  Does anyone have any doc for
  this thing?
  
   Jerry Jalenak
   Development Manager, Web Publishing
   LabOne, Inc.
   10101 Renner Blvd.
   Lenexa, KS  66219
   (913) 577-1496
  
   [EMAIL PROTECTED]
  
  
-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 6:13 AM
To: Struts User Jakarta
Subject: Tomcat 4 Compression Filter
   
   
There is a CompressionFilter class shipped with with Tomcat
which compresses the ServletResponse that I'm considering
using (we have some remote offices which have slow links):
   
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
ava?rev=1.8view=auto
   
It looks OK to me and seems to work fine when I plug it
  into my app.
   
I'm a bit concerned that its only an example class rather
than standard feature of Tomcat.
   
Has anyone used this in a 'live' environment and if so are
there any issues or with it or recommendations?
   
Does anyone have any alternatives that they have deployed?
   
Niall
 
  -- 
  Kris Schneider mailto:[EMAIL PROTECTED]
  D.O.Tech   http://www.dotech.com/
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 This transmission (and any information attached to it) may be confidential
and
 is intended solely for the use of the individual or entity to which it is
 addressed. If you are not the intended recipient or the person responsible
for
 delivering the transmission to the intended recipient, be advised that you
 have received this transmission in error and that any use, dissemination,
 forwarding, printing, or copying of this information is strictly
prohibited.
 If you have received this transmission in error, please immediately notify
 LabOne at the following email address:
[EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 4 Compression Filter

2004-02-25 Thread rick
Can you enable mod_gzip and/or mod_deflate for Apache?  I've always felt that's a
better deliniation of responsibilities between the servers.

Rick DeBay

On Wed, 25 Feb 2004 08:58 , Jerry Jalenak [EMAIL PROTECTED] sent:

I've also been playing around with this with mixed results.  I've been
looking for some doc on the filter mainly to better understand the
'compressThreshold' setting.  Does anyone have any doc for this thing?

Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


 -Original Message-
 From: Niall Pemberton
[EMAIL PROTECTED]','','','')[EMAIL PROTECTED]
 Sent: Wednesday, February 25, 2004 6:13 AM
 To: Struts User Jakarta
 Subject: Tomcat 4 Compression Filter
 
 
 There is a CompressionFilter class shipped with with Tomcat 
 which compresses the ServletResponse that I'm considering 
 using (we have some remote offices which have slow links):
 
 http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
 xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
 ava?rev=1.8view=auto
 
 It looks OK to me and seems to work fine when I plug it into my app.
 
 I'm a bit concerned that its only an example class rather 
 than standard feature of Tomcat. 
 
 Has anyone used this in a 'live' environment and if so are 
 there any issues or with it or recommendations?
 
 Does anyone have any alternatives that they have deployed?
 
 Niall
 

This transmission (and any information attached to it) may be confidential and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 4 Compression Filter

2004-02-25 Thread rick
I wouldn't compress anything less than a packet.  A good minimum packet size is
576 bytes, so call it 512 to account for headers and to make it even.
I'd still use Apache and mod_gzip/mod_deflate as that will make caching proxies
much happier.

Rick DeBay

On Wed, 25 Feb 2004 09:57 , Jerry Jalenak [EMAIL PROTECTED] sent:

Kris - Thanks.  So what's a reasonable setting?  The example has the
threshold set to 10; is this OK for most web apps? 



Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


 -Original Message-
 From: Kris Schneider [EMAIL PROTECTED]','','','')[EMAIL PROTECTED]
 Sent: Wednesday, February 25, 2004 9:42 AM
 To: Struts Users Mailing List
 Subject: RE: Tomcat 4 Compression Filter
 
 
 Essentially, the compressionThreshold filter init param is 
 a buffer size for
 CompressionResponseStream. If it's 0, then compression is 
 turned off (this is
 handled by the filter, not the stream). Otherwise, it's the max of 128
 (hard-coded min) and whatever is set in web.xml. The stream 
 works by buffering
 up bytes and periodically flushing them to a GZIPOutputStream 
 that wraps the
 response's ouput stream.
 
 Quoting Jerry Jalenak [EMAIL PROTECTED]:
 
  I've also been playing around with this with mixed results. 
  I've been
  looking for some doc on the filter mainly to better understand the
  'compressThreshold' setting.  Does anyone have any doc for 
 this thing?
  
  Jerry Jalenak
  Development Manager, Web Publishing
  LabOne, Inc.
  10101 Renner Blvd.
  Lenexa, KS  66219
  (913) 577-1496
  
  [EMAIL PROTECTED]
  
  
   -Original Message-
   From: Niall Pemberton
[EMAIL PROTECTED]','','','')[EMAIL PROTECTED]
   Sent: Wednesday, February 25, 2004 6:13 AM
   To: Struts User Jakarta
   Subject: Tomcat 4 Compression Filter
   
   
   There is a CompressionFilter class shipped with with Tomcat 
   which compresses the ServletResponse that I'm considering 
   using (we have some remote offices which have slow links):
   
   http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
   xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
   ava?rev=1.8view=auto
   
   It looks OK to me and seems to work fine when I plug it 
 into my app.
   
   I'm a bit concerned that its only an example class rather 
   than standard feature of Tomcat. 
   
   Has anyone used this in a 'live' environment and if so are 
   there any issues or with it or recommendations?
   
   Does anyone have any alternatives that they have deployed?
   
   Niall
 
 -- 
 Kris Schneider [EMAIL PROTECTED]','','','')[EMAIL PROTECTED]
 D.O.Tech   http://www.dotech.com/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

This transmission (and any information attached to it) may be confidential and
is intended solely for the use of the individual or entity to which it is
addressed. If you are not the intended recipient or the person responsible for
delivering the transmission to the intended recipient, be advised that you
have received this transmission in error and that any use, dissemination,
forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify
LabOne at the following email address: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 4 Compression Filter

2004-02-25 Thread Kris Schneider
It should probably also be mentioned that the JSP buffer can play a role in how
this thing works. The page implementation will generally have a buffer of its
own, the default size for JSP 1.2 is at least 8KB (it can be changed with the
page directive). If the page implementation writes a buffer whose content
length is greater than the compression stream's buffer size, then the page's
buffer will be written directly to the GZIP stream.

Quoting Niall Pemberton [EMAIL PROTECTED]:

 If you set it less than 10, it will get re-set to 128 (unless its zero)
 
 - Original Message - 
 From: Jerry Jalenak [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Wednesday, February 25, 2004 3:57 PM
 Subject: RE: Tomcat 4 Compression Filter
 
 
  Kris - Thanks.  So what's a reasonable setting?  The example has the
  threshold set to 10; is this OK for most web apps?
 
 
 
  Jerry Jalenak
  Development Manager, Web Publishing
  LabOne, Inc.
  10101 Renner Blvd.
  Lenexa, KS  66219
  (913) 577-1496
 
  [EMAIL PROTECTED]
 
 
   -Original Message-
   From: Kris Schneider [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, February 25, 2004 9:42 AM
   To: Struts Users Mailing List
   Subject: RE: Tomcat 4 Compression Filter
  
  
   Essentially, the compressionThreshold filter init param is
   a buffer size for
   CompressionResponseStream. If it's 0, then compression is
   turned off (this is
   handled by the filter, not the stream). Otherwise, it's the max of 128
   (hard-coded min) and whatever is set in web.xml. The stream
   works by buffering
   up bytes and periodically flushing them to a GZIPOutputStream
   that wraps the
   response's ouput stream.
  
   Quoting Jerry Jalenak [EMAIL PROTECTED]:
  
I've also been playing around with this with mixed results.
I've been
looking for some doc on the filter mainly to better understand the
'compressThreshold' setting.  Does anyone have any doc for
   this thing?
   
Jerry Jalenak
Development Manager, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
   
[EMAIL PROTECTED]
   
   
 -Original Message-
 From: Niall Pemberton [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 25, 2004 6:13 AM
 To: Struts User Jakarta
 Subject: Tomcat 4 Compression Filter


 There is a CompressionFilter class shipped with with Tomcat
 which compresses the ServletResponse that I'm considering
 using (we have some remote offices which have slow links):

 http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/e
 xamples/WEB-INF/classes/compressionFilters/CompressionFilter.j
 ava?rev=1.8view=auto

 It looks OK to me and seems to work fine when I plug it
   into my app.

 I'm a bit concerned that its only an example class rather
 than standard feature of Tomcat.

 Has anyone used this in a 'live' environment and if so are
 there any issues or with it or recommendations?

 Does anyone have any alternatives that they have deployed?

 Niall
  
   -- 
   Kris Schneider mailto:[EMAIL PROTECTED]
   D.O.Tech   http://www.dotech.com/

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 4 Compression Filter

2004-02-25 Thread Christian Bollmeyer
On Wednesday 25 February 2004 15:58, Jerry Jalenak wrote:
 I've also been playing around with this with mixed results.  I've
 been looking for some doc on the filter mainly to better understand
 the 'compressThreshold' setting.  Does anyone have any doc for this
 thing?

IIRC the 4.x filter used to be rather undocumented, but  you can easily
tell what it does by looking at the sources. Two things I may note
is that 1.) compressing anything else than text/html or text/plain
may show unsatisfactory results; some things just don't work at
all when using compression (VCARDs, for example) 2. IIRC there
is a memory leak issue with the GZip packages in some Java
versions, so it's a good idea to do proper load testing before
going live. One option for high-volume sites is to set up a
dedicated 'compression server' which does the job, and that
one doesn't necessarily have to run Java. Generally, compression
can easily speed up page delivery by factor 4 (if the browser
understands GZIP, which IE and recent Mozilla versions do,
at least), but you have to weigh this benefit against the
additional overhead imposed on the server side. BTW,
IMHO the TC 4.x filter's built in compression minimum
threshold of 128K is way too big (with pages being that
big: don't forget the buffer); most pages are smaller,
and the performance boost hooks in at smaller file
sizes as well. 32KB might be a good starting point
for further explorations in this direction. 

HTH,
-- Chris. 

 Jerry Jalenak
 Development Manager, Web Publishing
 LabOne, Inc.
 10101 Renner Blvd.
 Lenexa, KS  66219
 (913) 577-1496

 [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 4 Compression Filter

2004-02-25 Thread Navjot Singh
put apache in front of tomcat and install mod_gzip with apache.
it will do almost everything you can wish for?

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 5:43 PM
To: Struts User Jakarta
Subject: Tomcat 4 Compression Filter


There is a CompressionFilter class shipped with with Tomcat which 
compresses the ServletResponse that I'm considering using (we have 
some remote offices which have slow links):

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/webapps/exampl
es/WEB-INF/classes/compressionFilters/CompressionFilter.java?rev=1.
8view=auto

It looks OK to me and seems to work fine when I plug it into my app.

I'm a bit concerned that its only an example class rather than 
standard feature of Tomcat. 

Has anyone used this in a 'live' environment and if so are there 
any issues or with it or recommendations?

Does anyone have any alternatives that they have deployed?

Niall

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Anyone using the compression filter from Tomcat 4.0 examples?

2003-09-09 Thread Mike Deegan
Hi all,

Has anyone implemented the compression filter contributed by Amy Roh from Sun to the 
Tomcat 4.0 examples Web application.?
The filter automatically compresses the response output stream, improving bandwidth 
utilization.

As documented in Jason Hunter's article for javaworld:
http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters-p3.html

The strategy of the CompressionFilter class is to examine the request headers to 
determine if the client supports compression, and if so, wrap the response object with 
a custom response whose getOutputStream() and getWriter() methods have been customized 
to utilize a compressed output stream.

I have it up and running in my development environment and haven't experienced any 
problems! Which is great!
I want to feel confident prior to releasing my app to Production, that there aren't 
any known problems waiting for me.

Has anyone experienced problems using it in production? 
Does the actual compression take too long for anyone? 
Did it prove to be a bottleneck for anyone?
Basically have people found this compression filter to be beneficial or detrimental?

I'm always looking for ways to improving bandwidth utilization. I'm just not sure what 
benefits the compression filter really give me - I searched the struts-users list and 
found little debate regarding this filter.

TIA,
Mike