jjhorner has asked for the wisdom of the Perl Monks concerning the following question:
I'm updating my Apache module (available in code section) and I'm wondering if the $r->dir_config call checks the config file each time, or if it stores all of the key value pairs in a hash. Since one of my values (DefaultLimit) will be in the httpd.conf file, and one of them (TimeLimit) will be user supplied in an .htaccess file, should I just call them both (if they exist) and store in temp variables, or should I just call them using the $r->dir_config each time they are needed?
I know this is a mod_perl question and not specifically a perl question, but I still think it is worth looking into.
For instance:
if ($r->dir_config('TimeLimit')) { if ($r->dir_config('TimeLimit') < $r->dir_config('Defa +ultLimit')) { $time_to_die = $r->dir_config('TimeLimit'); } else { $time_to_die = $r->dir_config('DefaultLimit'); } } else { $time_to_die = $r->dir_config('DefaultLimit'); }
Or
my ($default, $time_to_die, $limit); $default = $r->dir_config('DefaultLimit'); $limit = $r->dir_config('TimeLimit') if ($r->dir_config('TimeLimi +t')); ($limit < $default) ? $time_to_die = $limit : $time_to_die = $def +ault;
Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: $r-dir_config and speed
by jjhorner (Hermit) on Jun 13, 2000 at 21:18 UTC | |
|
Re: $r-dir_config and speed
by plaid (Chaplain) on Jun 14, 2000 at 23:21 UTC |