Re: HTML_Template_Sigma again

From: Date: Thu, 27 Mar 2003 07:03:41 +0000
Subject: Re: HTML_Template_Sigma again
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14655@lists.php.net to get a copy of this message
Fabien MARTY wrote:
Yet, I had a look at Sigma code... IMHO, there is no cache system inside but a clever "pre-compilation" of the template (like Smarty). Because you don't store the resulting final html code but a "Sigma friendly state of the template".
Precisely! Maybe I was wrong to use the 'cache' word, and sould have used 'compiled templates' or something. Though unlike Smarty the templates are not compiled to PHP code but are saved as serialized arrays. And yes, this is just a template engine, that does not *know* anything about data being substituted, so I do not try to do anything with it.
So... Cache_Lite and Template_Sigma are not incompatible.
Yes, they cover different grounds: 1) If the page is mostly "static", you can cache the resulting HTML using Cache_Lite, and that will definitely work faster than processing it with template engine on every request. 2) If the page is truly dynamic (and that usually means that it has *lots* of blocks) then you use the built-in 'cache'/'compilation' code. Processing time is there, but no time is wasted to parse the template to find all the blocks. So neither of the solutions is the replacement of the other, they work best in *different* situations.
But you > have to precise that your cache is more a precompilation than a real cache system.
I tried my best to be precise in the documentation/comments. If there are some misleading parts, I'd be glad to hear about them.

« previous php.pear.dev (#14655) next »