Conditionally Setting HTTP Response Header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

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.

Example:
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.

Regards
Anurag

------------------------------------------------------------------
Anurag Kapur
Associate - Technology,
Sapient Corporation.

http://www.linkedin.com/in/anuragkapur

http://www.google.com/profiles/anuragkapur
------------------------------------------------------------------

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux