httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <di...@webweaving.org>
Subject Caching the useful headers
Date Fri, 08 Feb 2008 17:26:53 GMT
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);
         };




Mime
View raw message