httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 44579] New: mod_cache doesn't handle If-Range correctly
Date Tue, 11 Mar 2008 15:16:13 GMT

           Summary: mod_cache doesn't handle If-Range correctly
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cache

Use mod_cache and mod_disk_cache.
Suppose an object is in the cache, but expired, and the backend has a newer
version of the object.
Request the object partially, using Range and If-Range, with an If-Range time
equal to the timestamp of the object in the cache.

Since the object has expired, mod_cache revalidates with the backend and
retrieves the newer version, deleting the old version from the cache.

According to the specification of If-Range in RFC2616, the server should
deliver the whole of the new version of the object, but instead it delivers
only the part of it specified in Range.

If the cached object is made current or deleted, If-Range requests are handled
correctly, until the backend version is updated again.

Looking towards the end of cache_save_filter in mod_cache.c:  

        /* Restore the original request headers and see if we need to
         * return anything else than the cached response (ie. the original
         * request was conditional).
        r->headers_in = cache->stale_headers;
        status = ap_meets_conditions(r);
        if (status != OK) {
            r->status = status;

            bkt = apr_bucket_flush_create(bb->bucket_alloc);
            APR_BRIGADE_INSERT_TAIL(bb, bkt);
        else {
            cache->provider->recall_body(cache->handle, r->pool, bb);

ap_meets_conditions always returns OK for an If-Range request, so in the
situation described above, the If-Range request gets treated like an
unconditional request.

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message