Since PHPTAL compiles the templates I don't thing you'll get a performance gain from caching in the session. It could even be slower since serialization/unserialization is an expensive operation.
Moreover since each visitor to the site will have its own independent session, for each visitor a cached object will be stored, which by default are persisted on disk. Not a big issue if you have plenty of space available but doesn't sound like an optimal solution. If you need to speed up the application try using an op-code cache like APC or eAccelerator, they will not only speed up your PHP code execution (no parsing needed) but also improve the performance of PHPTAL's compiled templates (which are just plain php files). ciao, Iván On Wed, Jun 18, 2008 at 12:47 PM, Mathias Jacob <[EMAIL PROTECTED]> wrote: > Is it a good "advice" to store a template into a php session like: > > $_SESSION["template"] = new PHPTAL('index.html'); > > because this would save a lot of sourcecode. Im using a "overall template" > and only change in most cases the content, like: > > $tpl->set('content', $content->execute()); // Where $content is another > phptal template > > but i dont know if this would kill the apache, bcause maybe the > $_SESSION["template"] will grow bigger and bigger ... > Hope you understand what i mean! > > -- > Thias Jacob > Mail - MSN > [EMAIL PROTECTED] > > _______________________________________________ > PHPTAL mailing list > PHPTAL@lists.motion-twin.com > http://lists.motion-twin.com/mailman/listinfo/phptal > _______________________________________________ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal