我有一个mod_perl系统接受来自不同客户端系统的API调用
假设在子perl程序中我有这样的调用,它做了一些繁重的处理
假设在子perl程序中我有这样的调用,它做了一些繁重的处理
$conf{$client_id} = generate_client_conf($client_id); # returns a ref to a hash
我想在其他子进程中重用这个变量$conf {$client_id}
我怎样才能做到这一点 ?
变量无法在startup.pl中加载,但需要在生成后进行缓存
解决方法
你应该使用
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.