httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <>
Subject Re: mod_autoindex caching
Date Sun, 31 Jul 2005 19:31:19 GMT wrote:

> I do not think that this will work as expected. Although mod_autoindex can be instructed
> to set a Last-Modified header via IndexOption TrackModified. It does not handle conditional
> GET requests (in contrast to HEAD request) in a resource saving manner, because it does
> regenerate the listing for any GET request. But from my point of view mod_cache tries
> revalidate the listing for each new client with a conditional GET request, thus causing
> mod_autoindex to regenerate the listing.

Hmmm... good point. Looking at mod_autoindex in more detail, it seems it 
doesn't add an ETag to the response that I can see, which means it can 
only cache based on Last-Modified. The autoindex page is made up of the 
directory listing as well as the results of some subrequests, making it 
difficult to calculate an ETag until the page is finished being 
rendered, at which time it's too late.

mod_expires can set Cache-Control: max-age for you, which will tell 
downstream caches (be they mod_cache, squid, or a browser cache) to 
consider any index younger than a predefined age as fresh, meaning no 
revalidation and no page regeneration.

The catch is that I am not 100% sure if caching is effective if the 
Cache-Control: max-age is present, but the ETag header is not.

What will be useful is an ETag filter, where requests smaller than a 
certain size, and who do not already have an ETag, can get an ETag added 
by hashing the content and headers, making the content cacheable.

Does anybody know if something like this exists already? Google 
searching the site shows that the only references to 
ETags are those based on files.


View raw message