httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 53767] htcacheclean deletes stale "vary" header files even if cache limits aren't reached
Date Fri, 24 Aug 2012 10:54:14 GMT

--- Comment #2 from andyh <> ---
(which is later than the one we're running, but I believe has the same issue);
looks like this is the section that's doing it:

        /* single data and header files may be deleted either in realclean
         * mode or if their modification timestamp is not within a
         * specified positive or negative offset to the current time.
         * this handling is necessary due to possible race conditions
         * between apache and this process
        case HEADER:
            current = apr_time_now();
            nextpath = apr_pstrcat(p, path, "/", d->basename,
                                   CACHE_HEADER_SUFFIX, NULL);
            if (apr_file_open(&fd, nextpath, APR_FOPEN_READ | APR_FOPEN_BINARY,
                              APR_OS_DEFAULT, p) == APR_SUCCESS) {
                len = sizeof(format);
                if (apr_file_read_full(fd, &format, len,
                                       &len) == APR_SUCCESS) {
                    if (format == VARY_FORMAT_VERSION) {
                        apr_time_t expires;

                        len = sizeof(expires);

                        if (apr_file_read_full(fd, &expires, len,
                                               &len) == APR_SUCCESS) {
                            apr_finfo_t finfo;


                            if (apr_stat(&finfo, apr_pstrcat(p, nextpath,
                                    CACHE_VDIR_SUFFIX, NULL), APR_FINFO_TYPE,
                                    || finfo.filetype != APR_DIR) {
                                delete_entry(path, d->basename, nodes, p);
                            else if (expires < current) {
                                delete_entry(path, d->basename, nodes, p);


Specifically, this part:
                            else if (expires < current) {
                                delete_entry(path, d->basename, nodes, p);

This seems to be deleting expired vary header files by design. But this breaks
CacheStaleOnError handling, as well as (but to a lesser extent) the
stale-while-revalidate function that CacheLock provides, for any resources that

Not sure if there's any reason to be deleting these header files? They'll get
deleted later on anyway, in purge(), if the cache is above limits. If there's
no other need, should these three lines simply be removed?

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message