Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 50301 invoked from network); 8 Feb 2008 17:27:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2008 17:27:38 -0000 Received: (qmail 87883 invoked by uid 500); 8 Feb 2008 17:27:27 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 87821 invoked by uid 500); 8 Feb 2008 17:27:27 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 87810 invoked by uid 99); 8 Feb 2008 17:27:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 09:27:27 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dirkx@webweaving.org designates 209.132.96.45 as permitted sender) Received: from [209.132.96.45] (HELO skutsje.san.webweaving.org) (209.132.96.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 17:27:11 +0000 Received: from [10.11.0.121] (5356CA0A.cable.casema.nl [83.86.202.10]) (authenticated bits=0) by skutsje.san.webweaving.org (8.12.9/8.12.9) with ESMTP id m18HQs2Q090371 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 8 Feb 2008 09:26:58 -0800 (PST) (envelope-from dirkx@webweaving.org) Message-Id: From: Dirk-Willem van Gulik To: dev@httpd.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Caching the useful headers Date: Fri, 8 Feb 2008 18:26:53 +0100 X-Mailer: Apple Mail (2.915) X-Virus-Checked: Checked by ClamAV on apache.org Right now we have a nice utility function: ap_cache_cacheable_hdrs_out() Make a copy of the headers, and remove from the copy any hop-by-hop headers, as defined in Section 13.5.1 of RFC 2616 (in cache_util.c, part of mod_cache.h public headers) which we can apply to both the in and outbound headers. Now as far as I can see -every- caching module will have to take care of the error headers and the content -- and filtering both in-and-out that way. So how about changing this to: - ap_cache_cacheable_hdrs_out(r); calls ap_cache_cacheable_hdrs AND Set Content-Type if not set AND overlays r->err_headers_out - ap_cache_cacheable_hdrs_in(r); calles ap_cache_cacheable_hdrs - ap_cache_cacheable_hdrs(pool, headers, server) (private) delete/cleanse as per RFC 2616 and as per CacheIgnoreHeaders Or is there a fundamental reason as to why some caches will not want to do the 'usual'* ? Thoughts ? Dw if (r->headers_out) { /* Table with just the cachable headers */ headers_out = ap_cache_cacheable_hdrs_out( r->pool, r->headers_out, r- >server); /* If not set in headers_out, set Content-Type */ if (!apr_table_get(headers_out, "Content-Type") && r->content_type) { apr_table_setn(headers_out, "Content-Type", ap_make_content_type(r, r- >content_type)); } headers_out = apr_table_overlay(r->pool, headers_out, r->err_headers_out); } if (r->headers_in) { apr_table_t *headers_in; headers_in = ap_cache_cacheable_hdrs_out(r->pool, r- >headers_in, r->server); };