On Mon, 16 Apr 2007, Ruediger Pluem wrote:

I have now tested this patch, and it seems to solve the problem. This is
on httpd-2.2.4 + patch for PR41475 + our mod_disk_cache patches.

Without the patch a HEAD on a cached expired object that isn't modified
will unconditionally return 304 and furthermore cause the cached object
to be deleted. We believe that this is the explanation to why it has
been so hard to track down this bug - it only bites one user and that
user usually has no clue on what happens, and even if we try to
reproduce it immediately afterwards it won't trigger.

With the patch stuff works like expected:
- A HEAD on a cached expired object that isn't modified will update
  the cache header and return the proper return code, it follows the
  same code path as other requests on expired unmodified objects.
- A HEAD on a cached expired object that IS modified will remove the
  object from cache and then decline the opportunity to cache the
  object.

Are you really sure that it gets deleted? cache->provider->remove_entity does
not really remove the object from the cache. Only cache->provider->remove_url
does this.

Yes, but the CACHE_REMOVE_URL filter will remove it, right? It removes the CACHE_REMOVE_URL filter only after it has decided that it's actually caching the response so it will bite in that case.

I consider the CACHE_SAVE filter already as hard to read (not your fault by any means), but from my point of view your patch does increase this (specificly I think about the rv = !OK line. I know that a similar trick is done some lines above, but I don't like that one either).

I also found rv=!OK ugly, but I just followed the established style to create a minimal patch without extra fuzz. Feel free to clean stuff up to improve readability, as long as the bug gets fixed I'm happy :)


/Nikke
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     [EMAIL PROTECTED]
---------------------------------------------------------------------------
 Push any key. Then push the "any other" key.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Reply via email to