I have a mod_perl system accepting API calls from different client systems Suppose in the child perl program I have calls like this which does some heavy processing
$conf{$client_id} = generate_client_conf($client_id); # returns a ref to a hash
I would like to re-use this variable $conf{$client_id} in other child processes How can I do this ?
The variables cannot be loaded at startup.pl ,but needs to be cached once it is generated
You should use Cache::FastMmap
In mod_perl, just open the cache at the global level in the appropriate module, which is executed as the server is starting and before it starts forking children, but you'll probably want to chmod or chown the file to the permissions of the apache process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With