Re: [SMARTY] Benchmarking cache and inserts
| From: | Paul Lockaby | Date: | Fri, 06 Jun 2003 17:03:01 +0000 |
| Subject: | Re: [SMARTY] Benchmarking cache and inserts | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9667@lists.php.net to get a copy of this message | ||
Alrighty, try this:
main.php
====================
$smarty->caching = 2; // different cache times for each page
// ... code ...
$smarty->cache_lifetime = 3600; // cache for one hour
$smarty->display($phdisplay, $cacheid);
maintemplate.tpl
====================
{insert name="images" template="foo" ...}
insert.images.php
====================
function insert_images($params, &$smarty) {
extract($params);
if (!$smarty->is_cached($template, $cacheid)) {
// ... code ...} $smarty->cache_lifetime = 600; // cache for 10 minutes return $smarty->fetch($template, $cacheid); } Last time I tried it, that all worked for me. -- Paul Lockaby paul@paullockaby.com http://www.paullockaby.com