At 10:38 +0200 2001.10.02, Jonas Liljegren wrote:
>If that's the case; how can I forse initialization (and caching) of
>needed parts in advance?  I would like to have this done before the
>main apache process is forked for the individual requests.  Wouldn't
>that save both process startup time as well as memory, since I would
>have more shared memory?

A technique I use is to, in the parent process, create and store the
template object, and then loop over all my existing templates and compile
them so they are cached into the object (temporarily turning off / catching
warnings, because they generate a lot in our case, when the proper input
variables are not passed in).  So then all the templates have been compiled
in the parent process, and when it forks, the template object and all
templates are ready to go.

It takes a bit more time for the parent process to start up, and more time
for each fork, but it is worth it, in our case.

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/


Reply via email to