| cheekeong.yong@gmail.com 2006-04-18, 12:45 am |
| I am trying to have Apache to compress the output from an J2EE
application server before it reaches the client browser.
I decided to setup a forward proxy using the samples from Apache
documentation using the httpd.conf file and started the server.
Summary, I am able to get the Apache proxy server working .
However, I am not able to get the J2EE application server output
compressed (using mod_deflate) before it reaches the browser when I set
the browser to use the newly setup Apache proxy.
Will subsequent browser request to the proxy server return compressed
output?
Do I have to do anything extra for dynamically generated page (JSPs,
Servlets) to get the mod_deflate working?
Thank you for any help on this.
Regards,
Chee Keong
Below are the details on what has been done for testing.
First, I uncomment all the "LoadModule proxy_module??????" lines
--------------------------------------------------------------
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Deny from all
Allow from MY_CLIENT_IP_ADDRESS
</Proxy>
-----------------------------------------------------------------
I was able to access the J2EE application using the newly configured
proxy.
Then after stopping the server , I decided to add the mod_deflate
configuration as given in the documentation. However, I noticed that my
download size (using a network tool call BitMeter) remain the same.
I tried to modify a few thing including changing the <Location /> tag
to <Location *> but it still does not compress.
Below is the sample from the documentation that I added to the end of
the configuration file.
------------------------------------------------------------------------------------
<Location />
# Insert filter
SetOutputFilter DEFLATE
# netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
----------------------------------------------------------------------------------------------------------
|