I forgot to mention last time that one of the main reasons I exposed $r->finfo
was because it's required in order to do some 1.0-type manipulations.
in mod_perl 1.0, you could allow Apache's default content handler serve static files as a sort of caching mechanism. one example of this is Apache::CacheContent
(which is based on the code here). the trick that makes it all work is that you write out a flat-file version of semi-dynamic content after URI translation then allow Apache to serve it as a flat file via
$r->filename($file);
HTTP_NOT_MODIFIED
, which gives you an extra boost for little cost.ap_update_mtime(r, r->finfo.mtime);
$r->filename()
but Apache is using $r->finfo->mtime()
in it's decision on whether to send HTTP_NOT_MODIFIED
.$r->filename()
updates the underlying finfo
structure as well. in mod_perl 2.0, there is less magic but more API exposure, which means you need to update the finfo
data yourself. so, in mod_perl 2.0 the idiom looks like this$r->filename($file); $r->finfo->stat($file, APR::FINFO_NORM, $r->pool);
finfo
so that Apache uses the proper data in making its caching (and other) decisions.