|No such thing as a small change|
Storing data with mod_perl (are those handlers different) ?by lindex (Friar)
|on Apr 08, 2001 at 16:14 UTC||Need Help??|
lindex has asked for the
wisdom of the Perl Monks concerning the following question:
Ok so the situation is this:
I have a simple perl script that does processes on files and is run from cron, this script reads a configuration file passed to it from command line.
I have yet another perl program, however it is not a script it is a package used as a handler for a mod_perl enabled apache web server with an apache configuration directive such as this ...
Now as you can see there is a PerlSetVar that is the path of a config file, this would be the same config file that the perl script running from cron uses. It is very important that these they read the same config.
So its simple enough for me to use the same config file parser in the handler as I am inside of the perl script running from cron.
Ah! but it would much faster if I cached the data in the config file inside of apache, instead of re-reading/parsing that config file for every request.
So question one is... what is the best method of caching data inside of apache like so?
And question two is... if I define another location directive that has the same handler would these two handler's share that cached data or would they be in seperate memory space inside of apache, and if they are in the same space whats the best way to seperate them?
I know I should rtfm :)