Re: [PHPTAL] Save PHPTAL into a PHP Session

2008-06-18 Thread Mathias Jacob
Am 18.06.2008, 13:10 Uhr, schrieb Iván -DrSlump- Montes  
<[EMAIL PROTECTED]>:



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.


Ah, this is what I mean ...
I thought it could be better if i create the index template once the  
visitor visits the page and just edit the content instead of generating  
every pagehit a new object.


Thanks!

I will use eAccelerator when my project starts the "public beta" :)

--
Thias Jacob
Mail - MSN
[EMAIL PROTECTED]

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] Save PHPTAL into a PHP Session

2008-06-18 Thread Iván -DrSlump- Montes
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


[PHPTAL] Save PHPTAL into a PHP Session

2008-06-18 Thread Mathias Jacob

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