httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <>
Subject Re: Adding purge/invalidation to mod_cache
Date Fri, 30 May 2008 09:25:52 GMT

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:
>> 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., 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 with the caching
virtual host being 'cachehost' will look like:

PURGE http://cachehost/someuri HTTP/1.1



View raw message