RE: JSP whitespace removal

2004-03-04 Thread Ralph Einfeldt
That is not exactly what he intends to do:

trimSpaces: Should white spaces in template text 
between actions or directives be trimmed ?, default false.

It is not trimming away whitespaces between HTML tags.

 -Original Message-
 From: Aadi Deshpande [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 03, 2004 11:33 PM
 To: Tomcat Users List
 Subject: Re: JSP whitespace removal
 
 
 consider using the trimSpaces option of the Jasper compiler in your 
 $CATALINA_BASE/conf/server.xml .
 

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



Re: JSP whitespace removal

2004-03-04 Thread Robert Krüger
I don't think that's what he's looking for. It merely trims the 
whitespaces between jsp-directives (i.e. newlines between taglib 
directives) which is not exactly the majority of whitespaces in 
realistic scenarios. I think what he's looking for is more like the 
result of outputting html through an xslt processor with no indenting 
and I don't think that exists for jasper.

Best regards,

Robert

it trims the spaces during page compilation.
make sure you blow away your work directory or otherwise edit your pages 
so that they get recompiled.
works really well for me.

-a

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

Robert Krüger
Signal7 GmbH
Brüder Knauss Str. 79
64285 Darmstadt
Germany
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


JSP whitespace removal

2004-03-03 Thread John Sidney-Woollett
Hi

We want to achieve a 10-15% data reduction of the HTML being served by our
webserver (generated by JSP pages). This will have an impact on our
bandwidth charges from our ISP...

We can achieve this by by simply removing all the \n\r, \t characters
and replacing repeated occurences of(double space) by   (single
space). But we don't want to do this in our source JSP files as they will
become unmaintainable/unreadable.

eg
table
  tr
tdColumn 1/td
tdColumn 2/td
  tr
/table

(69 characters)

becomes

tabletrtdColumn 1/tdtdColumn 2/tdtr/table

(57 characters), that's an 17% saving for that text block...

I know that we could:

i) write/implement a filter to process the outputstream - BUT we use
OSCache (www.opensymphony.com) to cache (included) JSP pages, and we don't
want to reprocess cached data using another filter.

ii) use a script to transform or preprocess our JSP pages before they are
deployed - simple, but may have code breaking (between dev and live
system) or maintenance implications?

iii) create a tag library to process a text block (or another JSP), BUT
we've heard a rumour that taglibs can be inefficient (is that true?)

Question: is it possible to use a directive in a JSP page to force the
compiler to remove these characters to achieve our desired data reduction?

Are there any other techniques or solutions that anyone else is using?

Thanks

John Sidney-Woollett

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



Re: JSP whitespace removal

2004-03-03 Thread Peter Lin
have you tried turning gzip compression?  that should produce similar bandwidth 
savings to stripping out extra carraige returns and double spaces.
 
you could always use the jasper plugin architecture to strip out excess stuff
 
peter lin


John Sidney-Woollett [EMAIL PROTECTED] wrote:
Hi

We want to achieve a 10-15% data reduction of the HTML being served by our
webserver (generated by JSP pages). This will have an impact on our
bandwidth charges from our ISP...

We can achieve this by by simply removing all the \n\r, \t characters
and replacing repeated occurences of   (double space) by   (single
space). But we don't want to do this in our source JSP files as they will
become unmaintainable/unreadable.

eg


Column 1
Column 2



(69 characters)

becomes

Column 1Column 2

(57 characters), that's an 17% saving for that text block...

I know that we could:

i) write/implement a filter to process the outputstream - BUT we use
OSCache (www.opensymphony.com) to cache (included) JSP pages, and we don't
want to reprocess cached data using another filter.

ii) use a script to transform or preprocess our JSP pages before they are
deployed - simple, but may have code breaking (between dev and live
system) or maintenance implications?

iii) create a tag library to process a text block (or another JSP), BUT
we've heard a rumour that taglibs can be inefficient (is that true?)

Question: is it possible to use a directive in a JSP page to force the
compiler to remove these characters to achieve our desired data reduction?

Are there any other techniques or solutions that anyone else is using?

Thanks

John Sidney-Woollett

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


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

RE: JSP whitespace removal

2004-03-03 Thread SH Solutions
Hi

 We want to achieve a 10-15% data reduction of the HTML being served by our
webserver (generated by JSP pages). This will have an impact on our
bandwidth charges from our ISP...

I cannot help you on this, but you should realise, that if you archive to
reduce you jsps output by  10%, this will affect you traffic only by about
2%.

We do have a server, which generated (according to access_log_*)
2.183.339.056 byte in 261.018 requests. But out provider counted about 9GB
of traffic. [Actually he is accounting on switch port level and therefor
including even ARP-requests, but anyway a lot of this traffic is based on
out tomcat server.]

cu
  Steffen


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



Re: JSP whitespace removal

2004-03-03 Thread John Sidney-Woollett
Peter Lin said:
 have you tried turning gzip compression?  that should produce similar
 bandwidth savings to stripping out extra carraige returns and double
 spaces.

We running Apache 1.3.x + JK + TC 5.0.x

What's better the gzip valve/filter in Tomcat, or try doing the
compression with an Apache module (if that's even possible for JSP
rendered pages)?

Also, is there a threshold below which the penalty for processing the
compression outweighs the data payload reductuion?

We want to be low bandwidth + responsive...

 you could always use the jasper plugin architecture to strip out excess
 stuff

Is there a link to some docs for this?

Thanks

John Sidney-Woollett

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



RE: JSP whitespace removal

2004-03-03 Thread John Sidney-Woollett
Steffen Heil said:
 I cannot help you on this, but you should realise, that if you archive to
 reduce you jsps output by  10%, this will affect you traffic only by about
 2%.

 We do have a server, which generated (according to access_log_*)
 2.183.339.056 byte in 261.018 requests. But out provider counted about 9GB
 of traffic. [Actually he is accounting on switch port level and therefor
 including even ARP-requests, but anyway a lot of this traffic is based on
 out tomcat server.]

That's a good point - we're also charged at the switch port level!

We have a traffic shaper so we can control the amount of bandwidth
(Mbit/sec) we use for outbound traffic, and we're trying to cram as much
data per second as we can within our (managed/shaped) limit.

In fact it seems that (gzip) compression is a better strategy for HTML/CSS
pages because it offers compression of 80%. But it's still better to
compress the pages after you strip the whitespace for a small final text
size.

Unfortunately we also have a lot of graphics (but at least once they are
cached by the browser) then we only have to deal with a HEAD request to
see if they have been updated...

Thanks for the feedback.

John Sidney-Woollett

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



Re: JSP whitespace removal

2004-03-03 Thread Peter Lin
 
the reduction depends on your html right?
 
if you use a lot of tables, you're likely to see 5-10x compression. The easiest trick 
is to save a couple of your biggest pages and zip them up.  Compare the file size. 
Now, if you have regular log reports, you can see which pages get requested the most 
and how many bytes it is.
 
from that you can get a fairly accurate estimate in total bytes sent per week/month. 
Stripping out carriage returns and tabs most likely won't give you as much as 
compression.  Here is an easy way to test it on other sites.
 
Load a site that uses gzip with a browser that support gzip and without. Compare the 
actual bytes sent and how much faster the page loads. I know from first hand 
experience verizon SuperPages reduced 60K+ to 6K when they started using compression. 
The user's perception is the page was 2-4x faster. 
 
peter lin


John Sidney-Woollett [EMAIL PROTECTED] wrote:
Peter Lin said:
 have you tried turning gzip compression? that should produce similar
 bandwidth savings to stripping out extra carraige returns and double
 spaces.

We running Apache 1.3.x + JK + TC 5.0.x

What's better the gzip valve/filter in Tomcat, or try doing the
compression with an Apache module (if that's even possible for JSP
rendered pages)?

Also, is there a threshold below which the penalty for processing the
compression outweighs the data payload reductuion?

We want to be low bandwidth + responsive...

 you could always use the jasper plugin architecture to strip out excess
 stuff

Is there a link to some docs for this?

Thanks

John Sidney-Woollett

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


-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

Re: JSP whitespace removal

2004-03-03 Thread Aadi Deshpande
consider using the trimSpaces option of the Jasper compiler in your 
$CATALINA_BASE/conf/server.xml .

-a

John Sidney-Woollett wrote:

Hi

We want to achieve a 10-15% data reduction of the HTML being served by our
webserver (generated by JSP pages). This will have an impact on our
bandwidth charges from our ISP...
We can achieve this by by simply removing all the \n\r, \t characters
and replacing repeated occurences of(double space) by   (single
space). But we don't want to do this in our source JSP files as they will
become unmaintainable/unreadable.
eg
table
 tr
   tdColumn 1/td
   tdColumn 2/td
 tr
/table
(69 characters)

becomes

tabletrtdColumn 1/tdtdColumn 2/tdtr/table

(57 characters), that's an 17% saving for that text block...

I know that we could:

i) write/implement a filter to process the outputstream - BUT we use
OSCache (www.opensymphony.com) to cache (included) JSP pages, and we don't
want to reprocess cached data using another filter.
ii) use a script to transform or preprocess our JSP pages before they are
deployed - simple, but may have code breaking (between dev and live
system) or maintenance implications?
iii) create a tag library to process a text block (or another JSP), BUT
we've heard a rumour that taglibs can be inefficient (is that true?)
Question: is it possible to use a directive in a JSP page to force the
compiler to remove these characters to achieve our desired data reduction?
Are there any other techniques or solutions that anyone else is using?

Thanks

John Sidney-Woollett

-
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: JSP whitespace removal

2004-03-03 Thread bpsouther
On Wednesday 03 March 2004 05:33 pm, you wrote:
 consider using the trimSpaces option of the Jasper compiler in your
 $CATALINA_BASE/conf/server.xml .

What, precisly does that do?

I've tried it and seen no difference in the resulting HTML.

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



Re: JSP whitespace removal

2004-03-03 Thread Aadi Deshpande
[EMAIL PROTECTED] wrote:

On Wednesday 03 March 2004 05:33 pm, you wrote:
 

consider using the trimSpaces option of the Jasper compiler in your
$CATALINA_BASE/conf/server.xml .
   

What, precisly does that do?

I've tried it and seen no difference in the resulting HTML.

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

it trims the spaces during page compilation.
make sure you blow away your work directory or otherwise edit your pages 
so that they get recompiled.
works really well for me.

-a

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