httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhattacharya, Sudip" <>
Subject [users@httpd] How to Enable/Disable mod_deflate compression basis custom request headers
Date Tue, 09 Oct 2012 20:14:40 GMT
Hi friends,

I have the following setup.
- Java application on WebLogic server sitting behind Apache Web Server in US.
- 2nd Apache as Caching Proxy setup in Europe to do local caching for Europe users. This is
proxying to the US apache server (not directly to weblogic).

Now, I have some JSPs which are sending uncompressed output from weblogic.
I want to enable mod_deflate for these JSPs, but with the following condition:
--Compressed JSP output should be served only on requests coming from the Europe apache server.
--I don't want compression when the request is coming directly to the US apache server.
The reason behind this, is that I want to do a side by side comparison of the performance
when an Europe user hits the US apache directly, vs when they come via the Europe proxy.

I have added the following custom request header in the Europe Apache configuration.
RequestHeader set RemoteUser "yes"

I want to enable compression on JSP output only when this RequestHeader is in the request,
and I want to do this in the US apache server, so that the data transmission from US to Europe
is compressed.

Can you guide me on how to do this?
How can I check for a custom request header in the request and then conditionally enable gzip
compression for specific extension/mime-types?

Sudip Kumar Bhattacharya

This e-mail (and any attachments), is confidential and may be privileged. It may be read,
copied and used only
by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure
or copying of its 
contents or any action taken in reliance on it is unlawful. Unintended recipients must notify
the sender immediately 
by e-mail/phone & delete it from their system without making any copies or disclosing
it to a third person.

View raw message