This is a discussion on weblogic mod_deflate within the Apache Web Server forums, part of the Web Server and Related Forums category; Has anyone been able to get WebLogic/Apache/Mod_deflate to work together? It apperas that when I configure compression in ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Has anyone been able to get WebLogic/Apache/Mod_deflate to work
together? It apperas that when I configure compression in my weblogic.conf file it is an all or nothing affair. That is compression works every file that weblogic app serers send or I can turn it off completely. The problem is PDF files don't like to get compressed to IE browsers so I would like to enable compression on text, html, jscript and turn it off for pdfs. Here is a snip of the weblogic.conf file: MatchExpression /wl/ WebLogicCluster=xxx.xxx.xxx.xxx:7701 SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/plain #AddOutputFilterByType DEFLATE application/pdf AddOutputFilterByType DEFLATE text/html text/css application/x-javascript SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe)$ no-gzip dont-vary <Location ~ ".js$|.css|.htm|.html"> SetHandler default-handler SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/plain # AddOutputFilterByType DEFLATE application/pdf AddOutputFilterByType DEFLATE text/html text/css application/x-javascript </Location> <Location ~ ".jar|.jpg|.jpeg|.png|.gif"> SetHandler default-handler </Location> Note how I tried to compress PDFs. SFF |
|
|||
|
"Scott" <scottf1129@aol.com> schreef in bericht
news:1103145405.297238.66950@f14g2000cwb.googlegro ups.com... > Has anyone been able to get WebLogic/Apache/Mod_deflate to work > together? > > It apperas that when I configure compression in my weblogic.conf file > it is an all or nothing affair. That is compression works every file > that weblogic app serers send or I can turn it off completely. > > The problem is PDF files don't like to get compressed to IE browsers so > I would like to enable compression on text, html, jscript and turn it > off for pdfs. Per http://httpd.apache.org/docs-2.0/mod/mod_deflate.html SetOutputFilter DEFLATE will indeed compress _all file types. Per http://httpd.apache.org/docs-2.0/mod...utfilterbytype use AddOutputFilterByType DEFLATE text/plain text/html text/css Use the file mime.types to find more types appropriate for you -within the limitations of the various browser by brand and version- HansH |
|
|||
|
So what you are saying is I am diong both at once?
I shoud then get rid of SetOutputFileter Deflate DEFLATE I should then ONLY put the lines: AddOutput FilterByType DEFLATE <whatever I want compressed.> So this is a syntax error in that I am both deflating everything and then trying to deflate specific stuff later? Scott |
|
|||
|
"Scott" <scottf1129@aol.com> schreef in bericht
news:1103209308.337258.107870@c13g2000cwb.googlegr oups.com... >"HansH" <hans@niet.op.het.net> > > "Scott" <scottf1129@aol.com> schreef in bericht > > news:1103145405.297238.66950@f14g2000cwb.googlegro ups.com... > > > Has anyone been able to get WebLogic/Apache/Mod_deflate to work > > > together? > > SetOutputFilter DEFLATE > > will indeed compress _all file types. > > use > AddOutputFilterByType DEFLATE text/plain text/html text/css > I shoud then get rid of SetOutputFileter DEFLATE > I should then ONLY put the lines: > AddOutput FilterByType DEFLATE <whatever I want compressed.> That is, without a space in AddOutputFilterByType > So this is a syntax error in that I Both you and WebLogic ... > am both deflating everything and > then trying to deflate specific stuff later? Though IIRC Apache does not attempt to compress twice. It should have reported the AddOutputFilterByType for being useless. HansH |
|
|||
|
That is what I thought, I will try it though.
It looks like Apache 2.0.x can't distinguish between streams from WebLogic. That is as the modules/filters load in Apache 2.0.49 it doesn't seem to know what to do with the stream from weblogic until it is already sent. It looks like Apache 2.2 (whenever it comes out will be a better job of filtering) http://httpd.apache.org/docs-2.1/mod/mod_filter.html Do you concur? Scott |
|
|||
|
"Scott" <scottf1129@aol.com> schreef in bericht
news:1103225422.001713.88840@z14g2000cwz.googlegro ups.com... You should make it a habbit to leave in some of the previous post, not all read news via a webfront. > That is what I thought, I will try it though. > It looks like Apache 2.0.x can't distinguish between streams from > WebLogic. Streams ... audio, video ... > That is as the modules/filters load in Apache 2.0.49 it doesn't seem to > know what to do with the stream from weblogic until it is already sent. .... should not be compressed this way. I do not understand what you are trying to state, please explain. HansH |
|
|||
|
WebLogic had a bug in how they worked with Location tags. Their SP4 to
their 8.1 Apache 2.0.xx plug-in fixes many issues. However Mod_deflate is not one of them. The issue seems to be that while we can log the content-type comming from the WebLogic server mod_deflate does not seem to know what to do with the content-type. I am presented with an either/or situation: deflate everything or deflate nothing, I can't seem to specify what to deflate. So this is why when we turn deflate on it works but then corrupts PDF files. Here is a snip of my new (working) weblogic.conf file: BTW there are many Weblogic servers called this is just an example and yes some are clustered. <Location "/xv/"> SetHandler weblogic-handler WebLogicHost xvhost WebLogicPort 7070 WLExcludePathOrMimeType *.css WLExcludePathOrMimeType *.gif WLExcludePathOrMimeType *.js AddOutputFilterByType DEFLATE text/* application/x-javascript </Location> #****************************** # DEFLATE doesn't work in the location tag or below either #AddOutputFilterByType DEFLATE text/* application/x-javascript SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe)$ no-gzip dont-vary <Location ~ ".js$|.css|.htm|.html"> SetHandler default-handler AddOutputFilterByType DEFLATE text/* application/x-javascript </Location> I have tried to put the AddOutPUtFilterByType in my httpd.conf or the virtual.conf that calls the above weblogic.conf but it does not work no matter where I put it. I think this is either a bug in mod_deflate or in the Apache 2.0.xx filter mechanism. I will look at the mod_deflate home page to see if this is addressed. I may also try to use mod_gzip in place of mod_deflate, don't know if that is a valid way to go or not. Any ideas welcome as I am being told that we will have to abandon Apache for the other webserver. I would really like to not so this but compression is a must. Scott |
|
|||
|
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 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe)$ no-gzip dont-vary Or try to add the pdf type in the SetEnvIfNoCase as follows: <Location "/xv/"> SetHandler weblogic-handler WebLogicHost xvhost WebLogicPort 7070 WLExcludePathOrMimeType *.css WLExcludePathOrMimeType *.gif WLExcludePathOrMimeType *.js </Location> #****************************** # DEFLATE would ignore pdf ???? SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe|pdf)$ no-gzip dont-vary Compression is absolutely needed - comments?? Scott |
|
|||
|
More research has led me to believe to put it like this:
SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe)$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary 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. Scott |
|
|||
|
I got pushed back on this and told this won't work!
Has someone else done this and have it work?1? Scott More research has led me to believe to put it like this: SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jar|exe)$ no-gzip dont-vary SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary 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 .. Scott |
| Thread Tools | |
| Display Modes | |
|
|