[EMAIL PROTECTED] 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 to
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 httpd.apache.org site shows that the only references to ETags are those based on files.

Regards,
Graham
--

Reply via email to