Index: modules/cache/mod_cache.c =================================================================== --- modules/cache/mod_cache.c (revision 687295) +++ modules/cache/mod_cache.c (working copy) @@ -57,11 +57,6 @@ ap_filter_t *next; ap_filter_rec_t *cache_out_handle; - /* Delay initialization until we know we are handling a GET */ - if (r->method_number != M_GET) { - return DECLINED; - } - conf = (cache_server_conf *) ap_get_module_config(r->server->module_config, &cache_module); @@ -110,6 +105,12 @@ rv = cache_select(r); if (rv != OK) { if (rv == DECLINED) { + + /* We dont have a cache and we are not cacheble. */ + if (r->method_number != M_GET) { + return DECLINED; + } + if (!lookup) { /* @@ -167,6 +168,13 @@ "file by %s cache", cache->provider_name); } return DECLINED; + } else { + /* We have a cache entry. Time to invalidate it if necessary */ + if ((r->method_number == M_POST) || (r->method_number == M_PUT) || + (r->method_number == M_DELETE)) { + cache_remove_url(cache, r->pool); + return DECLINED; + } } /* if we are a lookup, we are exiting soon one way or another; Restore