On Wed, 9 May 2001, Morbus Iff wrote:
> Hey there, wondering if anyone could help me with this.
>
> I'm relatively new to mod_perl... I've got a 700k file that is loaded each
> time I run a CGI script, so I'm hoping to cache the file using mod_perl
> somehow. The file will change occasionally (maybe once a week) - the reload
> of a few seconds isn't worrisome, but it has to be done without restarting
> the server.
>
> Any suggestions on exactly the best way to do this? I've going to:
>
> - PerlSetupEnv Off
> - PerlModule and PerlRequre
> - Remove buffering.
> - Cache from XML::Simple **
>
> ** The 700k file is an XML file, read in by XML::Simple. XML::Simple can
> cache that file into memory. Is this how I should do it? Or should I load
> the file from my startup.pl script so that the file is shared amongst all
> the apache children? If that's the case, how would I dynamically reload it?
Boy you sure got some complex answers...
I store a .stor file which is a storable dump of my XML tree. I check the
mtime of that against the mtime of the .xml file. Whichever is newer I
load that. Works fast and is very simple.
--
<Matt/>
/|| ** Founder and CTO ** ** http://axkit.com/ **
//|| ** AxKit.com Ltd ** ** XML Application Serving **
// || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
// \\| // ** mod_perl news and resources: http://take23.org **
\\//
//\\
// \\