On 05/18/2007 11:26 PM, Justin Erenkrantz wrote: > On 5/18/07, Ruediger Pluem <[EMAIL PROTECTED]> wrote: > >> > Well, because rv == !OK, wouldn't the CACHE_REMOVE_URL filter hit? >> > That should do the dirty deed, no? -- justin >> >> No, as the CACHE_REMOVE_URL filter will only work if there is a >> cache->handle or a cache->stale_handle. We have neither, as >> cache->stale_handle >> is set to NULL in the case that the cached entity is *really* stale >> and we do >> not create a new entity (and thus a cache->handle) in the HEAD case. > > > Well, let's not clear cache->stale_handle then. How does the > following look? -- justin
Good :-). Thanks. > > Index: modules/cache/mod_cache.c > =================================================================== > --- modules/cache/mod_cache.c (revision 539607) > +++ modules/cache/mod_cache.c (working copy) > @@ -477,8 +477,10 @@ > reason = "No Last-Modified, Etag, or Expires headers"; > } > else if (r->header_only) { > - /* HEAD requests */ > - reason = "HTTP HEAD request"; > + /* Forbid HEAD requests unless we have it cached already */ > + if (!cache->stale_handle) { > + reason = "HTTP HEAD request"; > + } > } > else if (!conf->store_nostore && > ap_cache_liststr(NULL, cc_out, "no-store", NULL)) { Is this correct? In the case that we have a HEAD request on a stale cached entity we would ignore any of the following conditions like Cache-Control: nostore, Cache-Control: private, an Authorization header in the request, Vary *, or r->no_cache being set and update the headers of the entity with the contents of the HEAD response. This sounds wrong to me. Why not using (r->header_only && !cache->stale_handle) instead? Regards RĂ¼diger