Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 12470 invoked from network); 10 Jan 2009 14:39:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2009 14:39:39 -0000 Received: (qmail 31766 invoked by uid 500); 10 Jan 2009 14:39:29 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 31745 invoked by uid 500); 10 Jan 2009 14:39:29 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 31736 invoked by uid 99); 10 Jan 2009 14:39:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 06:39:28 -0800 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of apache-users@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 14:39:21 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LLezM-0002fL-HP for users@httpd.apache.org; Sat, 10 Jan 2009 14:39:00 +0000 Received: from ip-118-90-92-109.xdsl.xnet.co.nz ([118.90.92.109]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Jan 2009 14:39:00 +0000 Received: from n.sherlock by ip-118-90-92-109.xdsl.xnet.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Jan 2009 14:39:00 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: users@httpd.apache.org From: Nicholas Sherlock Date: Sun, 11 Jan 2009 03:38:54 +1300 Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-118-90-92-109.xdsl.xnet.co.nz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0 In-Reply-To: Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Re: mod_headers: Don't add a header if it is already present 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: apache_setenv("Cache_Aware","yes"); 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! Cheers, Nicholas Sherlock --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org