On Fri, Feb 07, 2003 at 03:14:39PM -0500, Vivek Khera wrote:
> Are you creating a new $ttobj for every request?

No!

> You should create
> one at server startup time and just reuse it for every request.

... in every child?

I'm creating $ttobj once _per child_:

        unless (defined ($ttobj) or ref($ttobj)) {
                $tt_obj = Template->new({
                        TRIM                                    =>      1,
#                       'PRE_CHOMP'                             =>      1,
                        'POST_CHOMP'                    =>      1,
                        INCLUDE_PATH                    =>      [
                                                                                       
 $c{'templates_base'},
                                                                                       
 $c{'documents_base'}
                                                                                ],
                        COMPILE_DIR                             =>      
$c{SYS}{'tt_cache_root'},
                        COMPILE_EXT                             =>      '.ttc2',
                        PRE_DEFINE      =>      {
                                # ...skipped
                        },
                        FILTERS =>      {
                                # ...skipped
                        },
                });
                debug("Template object (re)created (PID:$$)",1);
        }
        else {
                debug("Template object     reused  (PID:$$)",1);
        }

        ...

        $ttobj->process(...);

where $ttobj - global variable in a BK_man::Utils (system module with
wide used utilites).

-- 
WBR, Andrey Brindeew.
"No one person can understand Perl culture completely"
(C) Larry Wall.

Attachment: msg03878/pgp00000.pgp
Description: PGP signature

Reply via email to