> -----Ursprüngliche Nachricht----- > Von: Neil Gunton > Gesendet: Montag, 5. Januar 2009 23:17 > An: dev@httpd.apache.org > Betreff: Re: Issues with mod_disk_cache and htcacheclean > > Ruediger Pluem wrote:
> > This seems to be a bug. Can you please try if the following > patch fixes this? > > I applied the patch and rebuilt httpd_proxy successfully. The new > htcacheclean runs ok, but still seems to leave behind the > orphan .header > files. At least, I tried running htcacheclean in single run > mode, thus: > > htcacheclean -t -p/var/cache/www -l100M > > Then I run my prune_cache_headers perl script, and it seems to still > find a bunch of orphaned .header files to delete. So it > doesn't appear > to have fixed the issue. I did confirm that the patch was applied. Can you try with the following additional patch and a clean cache? Afterwards there should only be very very few orphaned header files left.: Index: modules/cache/mod_disk_cache.c =================================================================== --- modules/cache/mod_disk_cache.c (revision 732705) +++ modules/cache/mod_disk_cache.c (working copy) @@ -558,6 +558,8 @@ str_to_copy = dobj->hdrsfile ? dobj->hdrsfile : dobj->datafile; if (str_to_copy) { char *dir, *slash, *q; + char *dot; + char *hdrs_file; dir = apr_pstrdup(p, str_to_copy); @@ -586,6 +588,18 @@ } slash = strrchr(q, '/'); *slash = '\0'; + /* + * Check if we just deleted a vary directory. If we did, the + * corresponding header file is of no use anymore. So delete + * it. + */ + dot = strrchr(slash + 1, '.'); + if (dot && (strcmp(dot + 1, CACHE_VDIR_SUFFIX) == 0)) { + *dot = '\0'; + hdrs_file = apr_pstrcat(p, dir, "/", slash + 1, + CACHE_HEADER_SUFFIX, NULL); + apr_file_remove(hdrs_file, p); + } } } } Regards Rüdiger