httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Sherlock <>
Subject [users@httpd] Re: mod_headers: Don't add a header if it is already present
Date Sat, 10 Jan 2009 14:38:54 GMT
Nicholas Sherlock wrote:
> However, some new pages I am now developing are cache-aware, and supply 
> their own Cache-Control headers which should not include the "private" 
> modifier. Is it possible for mod_headers to not create this header if 
> the response (from PHP) already includes a Cache-Control header? 

I found one solution. In my cache-aware PHP pages I can use this code:


Then mod_headers can look for the environment variable:

Header append Cache-Control "private" env=!Cache_Aware

However, this is suboptimal. Once I eventually fix all of my pages to be 
properly cache-aware, the mod_header directive which adds 'private' will 
no longer be useful, and I'll have a lot of PHP code which needlessly 
sets an Apache environment variable. It'd be great if you could easily 
check for an existing _response_ header in mod_headers!

Nicholas Sherlock

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message