William A. Rowe, Jr. wrote:
[...]
>> 2. From a return-on-investment perspective, the static cache
>> looks a lot more appealing than the dynamic cache. I.e., I
>> anticipate that a static cache will offer 80% of the performance
>> benefit of a dynamic one for 20% of the development cost. (In
>> particular, a static cache is a *lot* cheaper to test, because
>> it's not vulnerable to the race conditions that make a dynamic
>> cache tricky.)
>>
>
>Agreed that this is simple to validate. I'll take some time to look at it, but
>I (imagine) that the tree walking *could* become a nightmare. I tend to think
>in terms of caching all cited <Directory> blocks, Alias targets, etc, which the
>user has identified with Override None.
>
>Could we implement your cache on an explicit - rather than tree-walking basis?
>I would think an info level warning that a given directory/alias could not be
>cached (due to AllowOverrides) would help the administrator troubleshoot their
>performance questions.
>
I think you and I might be talking about different trees. Are you
thinking of pre-scanning for htaccess files in selected dirs in the
document root? The tree that I'm walking through in the patch is a
virtual one formed by finding prefix-match relationships among the
<Directory> pathnames. E.g., if there are <Directory> blocks in
httpd.conf for /foo, /bar, /foo/bar, and /*/icons, then the pre-merge
algorithm creates 5 cached configs:
server_default+/foo
server_default+/bar
server_default+/foo+/foo/bar
server_default+/foo+/*/icons
server_default+/bar+/*/icons
If we get a request for /foo/bar/etc/index.html, and there's an htaccess
file under /foo/bar/etc, then the code takes the pre-merged config for
server_default+/foo+/foo/bar, loads the htaccess file, and overlays the
config from the htaccess file on top of the pre-merged config to get the
configuration that it uses for the request. (So directory_walk ends up
doing one dir-merge, instead of the three that it would do in this example
without caching.) Are you thinking of a more general solution where we
statically cache selected htaccess files too?
--Brian