weblogic mod_deflate

This is a discussion on weblogic mod_deflate within the Apache Web Server forums, part of the Web Server and Related Forums category; "Scott" <scottf1129@aol.com> schreef in bericht news:1103308850.714698.67110@f14g2000cwb.googlegro ups.com... You ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 12-17-2004
HansH
 
Posts: n/a
Default Re: weblogic mod_deflate

"Scott" <scottf1129@aol.com> schreef in bericht
news:1103308850.714698.67110@f14g2000cwb.googlegro ups.com...

You should make it a habbit to leave in some of the previous post -at least
the (nick)name to whos post your respondiong- , not all read news via a
webfront.

> Recap: When I get dynamic content from weblogic I can't control how to
> compress it with mod_deflate. I can log and therefore know what the
> content-type is however. If I set SetOutputFilter DEFLATE everything
> gets compressed. I need to control pdfs and not compress them.
> AddOutputFilterbyType does not seem to work so I got two ideas.
>
> Looking at the documentation I have come up with two ideas:
>
> Configure defalte to do the following:
>
> <Location "/xv/">
> SetHandler weblogic-handler
> WebLogicHost xvhost
> WebLogicPort 7070
> WLExcludePathOrMimeType *.css
> WLExcludePathOrMimeType *.gif
> WLExcludePathOrMimeType *.js
> </Location>
> #******************************
> # DEFLATE would not compress pdf ???
>
> SetOutputFilter DEFLATE
> RemoveOutFilter DEFLATE application/pdf

Setaside a typo, this directive requires an extention rather than a
mime-type 'RemoveOutputFilter pdf'

> SetOutputFilter DEFLATE
> SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe|pdf)$ no-gzip
> dont-vary


Both will only work if your request is showing .pdf as its extention ... if
your application 'suddenly' decides to dump a pdf file -even if it passes
the proper content-type header-, I guess, your troubles will persist.


BTW, is
AddOutput FilterByType DEFLATE <whatever>
not working at all?


HansH



  #12 (permalink)  
Old 12-18-2004
Scott
 
Posts: n/a
Default Re: weblogic mod_deflate

HansH,

Short of coping and pasting stuff again I don't see a way of putting
the previous posts into my replies. I will copy and paste because I
know what you are going through. I am using Google's group function
and it works really quite well except for the posting situation.

Now to the problem, I must have spent 4-5 hours looking at docs,
tutorials and other stuff referencing this issue. It boils down to
this:

I am pretty confident that the WebLogic/Apache mix leads to this
behaviour. I am able to compress and not compress at will except
through Weblogic. BEA blames Apache's filter mechanism.

AddOutPutFilterByType simply does not work.

SetOutputfilter DEFLATE works well, except for the PDF issue.

The SetEnvIfNoCase functions as expected as I am not compressing any of
the graphics from WebLogic. Most of the docs has the 2 SetEnvIfNoCase
commands separate but I can't imagine that adding PDF to the line I
have thus:

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe|pdf)$ no-gzip
dont-vary [This is all on one line].

Will cause me trouble and if it does I can always add it as new line.

I hope it works as I am getting a lot of static about compression, "We
really need it, etc, blah, blah"

I will let you know what BEA says and also try it out on Monday to see
if it works and appreciate bouncing the ideas off you.
Thank you and have a beverage of your choice this weekend,

Scott

  #13 (permalink)  
Old 12-18-2004
HansH
 
Posts: n/a
Default Re: weblogic mod_deflate

"Scott" <scottf1129@aol.com> schreef in bericht
news:1103337634.798129.321180@z14g2000cwz.googlegr oups.com...
> It boils down to this:
> I am pretty confident that the WebLogic/Apache mix leads to this
> behaviour. I am able to compress and not compress at will except
> through Weblogic. BEA blames Apache's filter mechanism.

By now I'm aware WebLogic is not just a bunch of CGI scripts and comes with
mod_wl. This module apparently acts like a reverse proxy with a dedicated
connection pool.

> AddOutPutFilterByType simply does not work.

That is, even using 'AddOutPutFilterByType text/html' a page of this content
type served by weblogic is sent to the browser without being compressed by
mod_deflate??

Check at your browser -FireFox with LiveHTTPheaders assumed- the
content-type header, might as wel be one of
application/xhtml+xml
application/xml
text/xml

> SetOutputfilter DEFLATE works well, except for the PDF issue.

Where the PDF issue is more browser than apache or weblogic related ...

> SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe|pdf)$
> no-gzip dont-vary [This is all on one line].

However, if I understood these directives -seen in a previous post-
correctly ...
http://e-docs.bea.com/wls/docs81/plu...in_params.html
WLExcludePathOrMimeType *.css
WLExcludePathOrMimeType *.gif
WLExcludePathOrMimeType *.js
.... reqeusts for some of the extentions in the regex are not forwarded by
mod_wl and thus the apache server is the only one controlling the response.

> I hope it works as I am getting a lot of static about compression, "We
> really need it, etc, blah, blah"

Googling the web this issue goes back to 1998 ... many have their scripts do
compression using java.util.zip.GZIPOutputStream, rather then trusting the
compression of an upfront proxy.



Twisting and bending every line to find an escape, I ran into a note
" The by-type output filters are never applied on proxy requests. "
at
http://httpd.apache.org/docs-2.0/mod...utfilterbytype

Quite disturbingly that sounds like turning an assumed bug into a _unwanted_
feature :-(

What platform are

> I will let you know what BEA says

.... advise them not to tell apache their mod_wl is a proxy ...

> and also try it out on Monday to see
> if it works and appreciate bouncing the ideas off you.

You're welkom ...

HansH



  #14 (permalink)  
Old 12-22-2004
Scott
 
Posts: n/a
Default Re: weblogic mod_deflate

Hello All,

I have been able to duplicate this behavior with Tomcat instead of
WebLogic.

I have cleaned up the below to hide the real server names but the
behavior is reproducable easily. Comments?

Scott

Config:

Apache-2.0.52 on Solaris-2.8 using prefork model


mod_jk proxying to backend Tomcat server.

mod_jk configured as such:

*****************
# Tomcat Configuration
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /tools/tomcat/v4.1.24/conf/workers.properties
JkLogFile /tools/tomcat/v4.1.24/logs/mod_jk.log
JkLogLevel debug
JkMount /opencms/* testWorker
*****************

Apache container configured as such:

# In the LoadModules section of my config file
LoadModule deflate_module modules/mod_deflate.so

In my Virtual Server config:

*****************
<VirtualHost *>
ServerAdmin test@testsvr.com
DocumentRoot /tools/apache/htdocs
ServerName testsvr.com
ErrorLog logs/testsvr_log
CustomLog logs/testsvr-clickstream clickstream
AddOutputFilterByType DEFLATE text/html text/plain text/css
#SetOutputFilter DEFLATE
</VirtualHost>
*****************

When I use the above settings for access my Tomcat web application and
make a request of the type:

GET /testsvr/home/ HTTP/1.0
Host: server.xxx.com
Accept-Encoding: gzip

I receive data back like this:

*****************
HTTP/1.1 200
Date: Wed, 22 Dec 2004 16:44:22 GMT
Server: OpenCms/5.0.0
Set-Cookie: Apache=172.20.110.128.1103733862842058; path=/;
domain=.testsvr.com
Set-Cookie: JSESSIONID=840A4735D6DB8011B8EAE68E5981081D; Path=/opencms
Content-Length: 23319
Connection: close
Content-Type: text/html; charset=ISO-8859-1


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

etc.....
*****************

No compression is turned on, even though:

- My client indicates it can support gzip
- mod_deflate has been configured to do output encoding for data of
type
text/html.

The problem appears to be how AddOutputFilterByType works on content
that is handled by another handler/filter.

If I instead out in my config file:

SetOutputFilter DEFLATE

I get compression, but on all content.

I want to compress only text/* content, and I cannot do it based on
Location,
Directory, or even URI matching expressions. I need to do it by
inspecting
the content type of the content returned from the web application.

  #15 (permalink)  
Old 12-22-2004
HansH
 
Posts: n/a
Default Re: weblogic mod_deflate

"Scott" <scottf1129@aol.com> schreef in bericht
news:1103741533.544843.23680@f14g2000cwb.googlegro ups.com...
> I have been able to duplicate this behavior with Tomcat instead of
> WebLogic.
>
> I have cleaned up the below to hide the real server names but the
> behavior is reproducable easily. Comments?
> Apache-2.0.52 on Solaris-2.8 using prefork model
> mod_jk proxying to backend Tomcat server.
> mod_jk configured as such:
> *****************
> # Tomcat Configuration
> LoadModule jk_module modules/mod_jk.so
> JkWorkersFile /tools/tomcat/v4.1.24/conf/workers.properties
> JkLogFile /tools/tomcat/v4.1.24/logs/mod_jk.log
> JkLogLevel debug
> JkMount /opencms/* testWorker
> *****************
> Apache container configured as such:
> # In the LoadModules section of my config file
> LoadModule deflate_module modules/mod_deflate.so
> In my Virtual Server config:
> *****************
> <VirtualHost *>
> ServerAdmin test@testsvr.com
> DocumentRoot /tools/apache/htdocs
> ServerName testsvr.com
> ErrorLog logs/testsvr_log
> CustomLog logs/testsvr-clickstream clickstream
> AddOutputFilterByType DEFLATE text/html text/plain text/css

This DOES NOT take extentions AT ALL, that's AddOutputFilter.
http://httpd.apache.org/docs-2.0/mod...ddoutputfilter
and that is unlikely to work for a request with a query string, addressing
the same script for any content.

I ran into this note too ...
" The by-type output filters are never applied on proxy requests. " at
http://httpd.apache.org/docs-2.0/mod...utfilterbytype
IMHO this may apply to both mod_wl abd mod_jk.

Sounds quite disturbing, might turn an assumed bug of mod_deflate into a
_unwanted_
feature of mod_mime :-(

HansH


  #16 (permalink)  
Old 12-23-2004
Scott
 
Posts: n/a
Default Re: weblogic mod_deflate

Hans

You are correct Addoutputfilter doesn't do what we want it to do.
Thank you for your paitence!

I would like to be able to "pre-compress" the .js .txt etc and make
..gzip pre-compressed versions of the files. Then when a browser asks
for .js file but can handle .gzip it would send the compressed
version. This would only be for static content but at least that
portion of the web site would be faster. I thinks it has something to
do with Content Negotiation (e.g. like when you allow different
languages) but how to set it up for compressed files?

Scott


HansH Dec 22, 1:48 pm show options
Newsgroups: alt.apache.configuration
From: "HansH" <h...@niet.op.het.net> - Find messages by this author
Date: Wed, 22 Dec 2004 22:48:30 +0100
Local: Wed, Dec 22 2004 1:48 pm
Subject: Re: weblogic mod_deflate
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

"Scott" <scottf1...@aol.com> schreef in bericht
news:1103741533.544843.23680@f14g2000cwb.googlegro ups.com...

- Hide quoted text -
- Show quoted text -
> I have been able to duplicate this behavior with Tomcat instead of
> WebLogic.


> I have cleaned up the below to hide the real server names but the
> behavior is reproducable easily. Comments?
> Apache-2.0.52 on Solaris-2.8 using prefork model
> mod_jk proxying to backend Tomcat server.
> mod_jk configured as such:
> *****************
> # Tomcat Configuration
> LoadModule jk_module modules/mod_jk.so
> JkWorkersFile /tools/tomcat/v4.1.24/conf/workers.properties
> JkLogFile /tools/tomcat/v4.1.24/logs/mod_jk.log
> JkLogLevel debug
> JkMount /opencms/* testWorker
> *****************
> Apache container configured as such:
> # In the LoadModules section of my config file
> LoadModule deflate_module modules/mod_deflate.so
> In my Virtual Server config:
> *****************
> <VirtualHost *>
> ServerAdmin t...@testsvr.com
> DocumentRoot /tools/apache/htdocs
> ServerName testsvr.com
> ErrorLog logs/testsvr_log
> CustomLog logs/testsvr-clickstream clickstream
> AddOutputFilterByType DEFLATE text/html text/plain text/css


This DOES NOT take extentions AT ALL, that's AddOutputFilter.
http://httpd.apache.org/docs-2.0/mod...ddoutputfilter
and that is unlikely to work for a request with a query string,
addressing
the same script for any content.

I ran into this note too ...
"
The by-type output filters are never applied on proxy requests. " at
http://httpd.apache.org/docs-2.0/mod...utfilterbytype

IMHO this may apply to both mod_wl abd mod_jk.

Sounds quite disturbing, might turn an assumed bug of mod_deflate into
a
_unwanted_
feature of mod_mime :-(

HansH

  #17 (permalink)  
Old 12-23-2004
HansH
 
Posts: n/a
Default Re: weblogic mod_deflate

"Scott" <scottf1129@aol.com> schreef in bericht
news:1103819083.377843.219120@c13g2000cwb.googlegr oups.com...
> HansH Dec 22, 1:48 pm show options
> "Scott" <scottf1...@aol.com> schreef in bericht
> news:1103741533.544843.23680@f14g2000cwb.googlegro ups.com...
> > > AddOutputFilterByType DEFLATE text/html text/plain text/css

> > This DOES NOT take extentions AT ALL, that's AddOutputFilter.
> > http://httpd.apache.org/docs-2.0/mod...ddoutputfilter
> > and that is unlikely to work for a request with a query string,
> > addressing the same script for any content.
> > You are correct Addoutputfilter doesn't do what we want it to do.


> > I ran into this note too ...
> > "The by-type output filters are never applied on proxy requests. " at
> > http://httpd.apache.org/docs-2.0/mod...utfilterbytype
> > IMHO this may apply to both mod_wl abd mod_jk.
> > Sounds quite disturbing, might turn an assumed bug of mod_deflate into
> > into a _unwanted_ feature of mod_mime :-(


> I would like to be able to "pre-compress" the .js .txt etc and make
> .gzip pre-compressed versions of the files. Then when a browser asks
> for .js file but can handle .gzip it would send the compressed
> version. This would only be for static content but at least that
> portion of the web site would be faster.

http://search.cpan.org/~sproctor/Apa...Precompress.pm

> I thinks it has something to
> do with Content Negotiation (e.g. like when you allow different
> languages) but how to set it up for compressed files?

http://search.cpan.org/~kwilliams/Ap...05/Compress.pm

No warranties, enjoy :-(

HansH


  #18 (permalink)  
Old 12-27-2004
Scott
 
Posts: n/a
Default Re: weblogic mod_deflate

HansH,

Perl?!? Not what I was looking for. Believe it or not there is not
ONE example I can find after 8+ hours looking at the available
documentation. Every document, tutorial, sample file I come accross
uses multiple languages as the example. For some reason I can't seem
to get my head around the process. Very furstrating!

Here is what I want to do: I will compress every .css, .js file with
gzip so in each location there will be:

foo.css foo.css.gz foo.js foo.js.gz

What I need to do now is figure out how to get an Apache .var file that
will allow Apache to serve the *.gz file to browsers that can handle
it and *.js to browsers that can't.

I might try to setup the Multiview options since each location will
defintely have each of the above files. I know this will work and get
a vague idea of how to do it with the examples based on multiple
languages but I really need a few pointers to translate the concepts
to compressed files.

Everyone here is convinced that compressing the files will save so much
bandwidth that the work of scripting the compression and configuring
Apache is small compared to the savings. Not so sure about that but I
am not in a position to argue.

Either way is fine by me - multiview or .var file but which is better?
Comments, as always are welcome by anyone reading this,

Scott

  #19 (permalink)  
Old 12-28-2004
HansH
 
Posts: n/a
Default Re: weblogic mod_deflate

"Scott" <scottf1129@aol.com> schreef in bericht
news:1104172818.941292.20620@f14g2000cwb.googlegro ups.com...
>> I would like to be able to "pre-compress" the .js .txt etc and make
>> .gzip pre-compressed versions of the files. Then when a browser asks
>> for .js file but can handle .gzip it would send the compressed
>> version. This would only be for static content but at least that
>> portion of the web site would be faster.

>http://search.cpan.org/~sproctor/Apa...Precompress.pm


>> I thinks it has something to
>> do with Content Negotiation (e.g. like when you allow different
>> languages) but how to set it up for compressed files?

>http://search.cpan.org/~kwilliams/Ap...05/Compress.pm


> Perl?!? Not what I was looking for.

You need a job done, so response comes in any taste ;-)

> Believe it or not there is not
> ONE example I can find after 8+ hours looking at the available
> documentation. Every document, tutorial, sample file I come accross
> uses multiple languages as the example. For some reason I can't seem
> to get my head around the process. Very furstrating!


> Here is what I want to do: I will compress every .css, .js file with
> gzip so in each location there will be:
> foo.css foo.css.gz foo.js foo.js.gz
>
> What I need to do now is figure out how to get an Apache .var file that
> will allow Apache to serve the *.gz file to browsers that can handle
> it and *.js to browsers that can't.
>
> I might try to setup the Multiview options since each location will
> defintely have each of the above files. I know this will work and get
> a vague idea of how to do it with the examples based on multiple
> languages but I really need a few pointers to translate the concepts
> to compressed files.
>
> Everyone here is convinced that compressing the files will save so much
> bandwidth that the work of scripting the compression

OT: have a 1000 row 20 column table in doing a ration of 15..20

Scripting is at the weblogic end ... there will be a gzip library for java
somewhere, perhaps even here:
http://ftpna2.bea.com/pub/downloads/Gzipfilter_war.zip
" Gzip Filter
A Servlet 2.3 filter which compresses the response stream using gzip. This
decreases the number of bytes transferred across the network for requests
which are able to accept gzip encoding. "
and a snippet of its readme
"Map all resources which can benefit from compression such as .txt, .log,
..html and .htm. You can also use the filter to compress output from jsps and
other dynamic content."

> and configuring Apache is small compared to the savings.
> Not so sure about that but I am not in a position to argue.

But for the 'will not gzip proxied requests'...
.... and then who cares if java did that job already

> Either way is fine by me - multiview or .var file but which is better?

You won't like to maintain 3 files as a set:
> foo.css foo.css.gz foo.css.var


However, I have some bad fealings about this ...
.... IMHO you're about to mix (up) Content-Encoding and transport encoding

BTW, where do the static files reside: at Apache's or at Weblogic's?



HansH


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:03 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0