https://issues.apache.org/bugzilla/show_bug.cgi?id=56881

            Bug ID: 56881
           Summary: mod_cache can send a 304 to unconditional req when
                    handling a contradiction on revalidation
           Product: Apache httpd-2
           Version: 2.4.10
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cache
          Assignee: [email protected]
          Reporter: [email protected]

I am seeing that even though this snippet below unsets the conditional headers,
something about r->status being 304 at the start of the internal redirect
causes the 304 to be returned

I set r->status to 333 as a stupid test right after unsetting conditionals and
could see the 333 being traced as a response code in the same path -- so the
304 is not due to the r->headers_in but some lingering r->status.


    if (reason && r->status == HTTP_NOT_MODIFIED && cache->stale_handle) {

        ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02473)
                "cache: %s responded with an uncacheable 304, "
                "retrying the request. Reason: %s",
                r->unparsed_uri, reason);

        /* we've got a cache conditional miss! tell anyone who cares */
        cache_run_cache_status(cache->handle, r, r->headers_out, AP_CACHE_MISS,
                apr_psprintf(r->pool,
                        "conditional cache miss: 304 was uncacheable, entity
removed: %s",
                        reason));

        /* remove the cached entity immediately, we might cache it again */
        ap_remove_output_filter(cache->remove_url_filter);
        cache_remove_url(cache, r);

        /* let someone else attempt to cache */
        cache_remove_lock(conf, cache, r, NULL);

        /* remove this filter from the chain */
        ap_remove_output_filter(f);

        /* retry without the conditionals */
        apr_table_unset(r->headers_in, "If-Match");
        apr_table_unset(r->headers_in, "If-Modified-Since");
        apr_table_unset(r->headers_in, "If-None-Match");
        apr_table_unset(r->headers_in, "If-Range");
        apr_table_unset(r->headers_in, "If-Unmodified-Since");

        ap_internal_redirect(r->unparsed_uri, r);

        return APR_SUCCESS;

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to