mod_cache.c revision 1f863242c3901a633082bab8a34e8cb7422ab421
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek/* ====================================================================
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * The Apache Software License, Version 1.1
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Redistribution and use in source and binary forms, with or without
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * modification, are permitted provided that the following conditions
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * 1. Redistributions of source code must retain the above copyright
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * notice, this list of conditions and the following disclaimer.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * 2. Redistributions in binary form must reproduce the above copyright
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * notice, this list of conditions and the following disclaimer in
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * the documentation and/or other materials provided with the
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * 3. The end-user documentation included with the redistribution,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * if any, must include the following acknowledgment:
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * "This product includes software developed by the
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Apache Software Foundation (http://www.apache.org/)."
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Alternately, this acknowledgment may appear in the software itself,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * if and wherever such third-party acknowledgments normally appear.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * 4. The names "Apache" and "Apache Software Foundation" must
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * not be used to endorse or promote products derived from this
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * software without prior written permission. For written
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * permission, please contact apache@apache.org.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * 5. Products derived from this software may not be called "Apache",
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * nor may "Apache" appear in their name, without prior written
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * permission of the Apache Software Foundation.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * ====================================================================
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * This software consists of voluntary contributions made by many
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * individuals on behalf of the Apache Software Foundation. For more
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * information on the Apache Software Foundation, please see
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Portions of this software are based upon public domain software
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * originally written at the National Center for Supercomputing Applications,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * University of Illinois, Urbana-Champaign.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmekmodule AP_MODULE_DECLARE_DATA cache_module;
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-SzmekAPR_OPTIONAL_FN_TYPE(ap_cache_generate_key) *cache_generate_key;
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek/* -------------------------------------------------------------- */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Can we deliver this request from the cache?
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * deliver the content by installing the CACHE_OUT filter.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * check whether we're allowed to try cache it
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * add CACHE_IN filter
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmekstatic int cache_url_handler(request_rec *r)
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek const char *cc_in, *pragma, *auth;
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek (cache_server_conf *) ap_get_module_config(r->server->module_config,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* we don't handle anything but GET */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek if (r->method_number != M_GET) return DECLINED;
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Which cache module (if any) should handle this request?
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek if (!(types = ap_cache_get_cachetype(r, conf, path))) {
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: URL %s is being handled by %s", path, types);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* make space for the per request config */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek cache = (cache_request_rec *) ap_get_module_config(r->request_config,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek cache = ap_pcalloc(r->pool, sizeof(cache_request_rec));
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_set_module_config(r->request_config, &cache_module, cache);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* save away the type */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Are we allowed to serve cached info at all?
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* find certain cache controlling headers */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek cc_in = apr_table_get(r->headers_in, "Cache-Control");
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek pragma = apr_table_get(r->headers_in, "Pragma");
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek auth = apr_table_get(r->headers_in, "Authorization");
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* first things first - does the request allow us to return
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * cached information at all? If not, just decline the request.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Note that there is a big difference between not being allowed
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * to cache a request (no-store) and not being allowed to return
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * a cached request without revalidation (max-age=0).
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Caching is forbidden under the following circumstances:
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * - RFC2616 14.9.2 Cache-Control: no-store
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * - Pragma: no-cache
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * - Any requests requiring authorization.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * - Any URLs whose length exceeds MAX_URL_LENGTH
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * - TODO: Make MAX_URL_LENGTH a config directive?
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek if (strlen(url) > MAX_URL_LENGTH) {
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: URL exceeds length threshold: %s", url);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek if (conf->ignorecachecontrol_set == 1 && conf->ignorecachecontrol == 1 && auth == NULL) {
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "incoming request is asking for a uncached version of %s, but we know better and are ignoring it", url);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek if (ap_cache_liststr(cc_in, "no-store", NULL) ||
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_cache_liststr(pragma, "no-cache", NULL) || (auth != NULL)) {
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* delete the previously cached file */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek cache_remove_url(r, cache->types, url);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: no-store forbids caching of %s", url);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * Try serve this request from the cache.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * If no existing cache file
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * add cache_in filter
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * If stale cache file
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * If conditional request
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * add cache_in filter
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * If non-conditional request
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * fudge response into a conditional
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * add cache_conditional filter
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * If fresh cache file
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * clear filter stack
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * add cache_out filter
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek rv = cache_select_url(r, cache->types, url);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* no existing cache file */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: no cache - add cache_in filter and DECLINE");
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* add cache_in filter to cache this request */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_add_output_filter("CACHE_IN", NULL, r, r->connection);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* return DECLINED */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* cache file exists */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* fresh data available */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: fresh cache - add cache_out filter and "
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "handle request");
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* We are in the quick handler hook, which means that no output
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * filters have been set. So lets run the insert_filter hook.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * XXX - Should we be inserting filters in the output stream
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * for proxy requests? Certainly we need the core filters
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * (byterange, chunking, etc.). I can also see the need to
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * conditionally insert tag processing filters (e.g. INCLUDES).
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* Now add the cache_out filter. cache_out is a FTYPE_CONTENT
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * which means it will be inserted first in the stream, which
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek * is exactly what we need.
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_add_output_filter("CACHE_OUT", NULL, r, r->connection);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* kick off the filter stack */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek out = apr_brigade_create(r->pool);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek if (APR_SUCCESS != (rv = ap_pass_brigade(r->output_filters, out))) {
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: error returned while trying to return %s "
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* stale data available */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: stale cache - test conditional");
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* if conditional request */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek if (ap_cache_request_is_conditional(r)) {
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: conditional - add cache_in filter and "
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* add cache_in filter */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_add_output_filter("CACHE_IN", NULL, r, r->connection);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* return DECLINED */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* else if non-conditional request */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* fudge response into a conditional */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: nonconditional - fudge conditional "
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* if we have a cached etag */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek apr_table_set(r->headers_in, "If-None-Match", info->etag);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek else if (info && info->lastmods) {
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: nonconditional - fudge conditional "
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* if we have a cached IMS */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "If-Modified-Since",
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* something else - pretend there was no cache */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: nonconditional - no cached "
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "etag/lastmods - add cache_in and DECLINE");
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* add cache_in filter to cache this request */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_add_output_filter("CACHE_IN", NULL, r, r->connection);
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* return DECLINED */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* add cache_conditional filter */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: nonconditional - add cache_conditional and"
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_add_output_filter("CACHE_CONDITIONAL",
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek /* return DECLINED */
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek ap_log_error(APLOG_MARK, APLOG_ERR, rv,
19887cd06a3af2f045e763986eda19e208bd3f85Zbigniew Jędrzejewski-Szmek "cache: error returned while checking for cached file by "
request_rec *r = f->r;
&cache_module);
if (!cache) {
int rv;
request_rec *r = f->r;
if(r->no_cache) {
if (!cache) {
/* XXX mod-include clears last_modified/expires/etags - this is why we have
r->header_only ||
r->no_cache) {
const char* cl;
if (cl) {
apr_bucket *e;
int all_buckets_here=0;
size=0;
if (APR_BUCKET_IS_EOS(e)) {
if (APR_BUCKET_IS_FLUSH(e)) {
if (e->length < 0) {
if (!all_buckets_here) {
char *dates;
r->server,
return ps;
return ps;
&cache_module);
return NULL;
&cache_module);
return NULL;
&cache_module);
return NULL;
void *dummy,
const char *type,
const char *url)
&cache_module);
return NULL;
&cache_module);
return NULL;
&cache_module);
double val;
return NULL;
&cache_module);
long val;
return NULL;
&cache_module);
double val;
return NULL;
&cache_module);
long val;
return NULL;
&cache_module);
double val;
return NULL;
&cache_module);
int val;
return NULL;
if (!cache_generate_key) {
return OK;
{NULL}