On 05/30/2008 11:13 AM, Ruediger Pluem wrote:


On 05/30/2008 10:28 AM, Colm MacCárthaigh wrote:
For one reason or another, I need to be able to invalidate cache
entries in some mod_cache caches. There's no "good" standard for this,
WCIP/BEEP went nowhere afaict, but I want to keep things simple. The
way Squid handles this is by implementing a non-standard PURGE HTTP
method, so I've taken the same approach here - in a very basic patch.

The patch actually works, you can call;

PURGE /foo HTTP/1.1
Host: example.org
Accept: foo/bar

and it will actually go and remove the item from whatever cache its
in, with the entity being negotiated as per the Accept headers.

But before I move on to tidying it up to return better codes, work
behind ACLs/auth,
handle the uncached case better and add a PurgeEnable directive (or
similar) - is this
style of invalidation something suitable for httpd at all? or would
people prefer to see
something more like mod_proxy_balancer's full-scale html interface for
doing this kind of thing at run-time?


I don't think that we need a html interface. So the approach looks ok for me. Things that need fixing as you already said is to ensure that this runs behind ACLs/auth and as a comment I would not call the cache_remove_url_filter

It would be also nice if the purge could be enabled only in a virtual host 
different
from the one that does the caching (e.g. 127.0.0.1:8080), but I guess this adds
some additional difficulties as the hostname of the virtual host doing the
caching is contained in the key. So special care would need to be taken with
the PURGE request. So sending a PURGE request to 127.0.0.1:8080 with the caching
virtual host being 'cachehost' will look like:

PURGE http://cachehost/someuri HTTP/1.1
....

Regards

Rüdiger

Reply via email to