Author: Alex Rousskov <rousskov@measurement-factory.com>
Bug #425 fix: purge matching entries on PUT, POST, and DELETE requests.
This patch focuses on purging URLs in Location and Content-Location headers
of PUT, POST, and DELETE responses.
Purging Request-URIs was already supported for PUT and DELETE, but needed
polishing. I moved all code related to method-based purging into one Server
method and outside the neighbors_do_private_keys guard (and store entry key is
private guard). We may purge more related entries than before.
I also implemented Amos' TODO to purge related entries when receiving a
request with an unknown request method. Again, we may now purge more related
entries than before.
My primary concern about the polishing part of the change is that the old code
used to check that the cache entry being purged is not the current entry:
assert(e != pe);
The new code does not check for that but appears to work in my limited tests.
I am not quite sure why we needed that check if all purging methods are not
cachable anyway. Perhaps it is unsafe to call e->release() for some entries?
TODO: We cannot find Vary-controlled entries by URL and, hence, we cannot
purge them, right?
TODO: Optimize method category "search" in HttpRequestMethod by using
precomputed method_id:category maps.