Not signed in (Sign In)
Welcome, Guest

Did you know that there is a whole world of functionality you're not seeing? If you have an account, sign in now.

If you don't have an account, apply for one now.

Bottom of Page
Savant2: Cache in savant2
  1.  
1 to 3 of 3
Jul 21st 2007
Hello,
I'm make a webapp with savant2, and i'm searching how can I create a cache.
Does a plugin can make it ?
Does it already exist a plugin ?

Perhaps with somme ob_function I can get the result of a page ?

Any other idea ?

Regards.
Jul 23rd 2007
If your goal is to cache the output of the template, use fetch() to store the output in a variable, then cache that variable using something like Cache_Lite. Psuedocode:

// build $cache (Cache_Lite instance)
if (!($html = $cache->get($cacheId))) {
// require Savant
// build $tpl (Savant instance)
// assign $tpl vars
$html = $tpl->fetch();
$cache->save($html);
}
echo $html;
  1.  
1 to 3 of 3
Top of PageBack to discussions