httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anurag Kapur <>
Subject [users@httpd] Conditionally Setting HTTP Response Header
Date Mon, 15 Mar 2010 12:50:36 GMT

I am looking for some help to set HTTP response headers conditionally. I
have a setup where HTTPD sits in front of Tomcat and proxies requests to it.

*Problem Statement*
Set a Cache-Control max-age directive in the HTTP response header through
HTTPD if it doesn't already exist. In addition if HTTPD after detecting that
the directive is not already set in the response header, it should set one
depending on the response mime-type.

HTTPD proxies a request to tomcat -> Tomcat processes the request and send
back the response to HTTPD -> HTTPD checks if Cache-Control max-age
directive is set in the response header. If present it does no changes to
the response header and simply forwards the response back to the user.
However, if the Cache-Control max-age directive is not present it sets one
depending on the response mime type (say max-age=900 for text/html and
max-age=1800 for image/gif)
*System Info*
$ apachectl -version
Server version: Apache/2.2.9 (Unix)
Server built:   Sep 12 2008 16:23:39

$ uname -a
SunOS vm-sol10-45 5.10 Generic_127128-11 i86pc i386 i86p

*What I Have Tried*
I have been trying to work with mod_setenvif module to start but have not
made any progress and thus seeking your help.

Any inputs would be highly appreciated.

Anurag Kapur
Associate - Technology,
Sapient Corporation.

View raw message