Re: [SMARTY] Benchmarking cache and inserts
| From: | Nino Katic | Date: | Fri, 06 Jun 2003 17:36:18 +0000 |
| Subject: | Re: [SMARTY] Benchmarking cache and inserts | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9670@lists.php.net to get a copy of this message | ||
On Fri, 6 Jun 2003, Paul Lockaby wrote:
> 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);
> }
>
Thx. Paul I'll try it. One more strange thing is that now (after maybe
1 hour) i tried to measure the time one more time with the same code, and
now i get results like 0,30 sec. insted of 0,70 sec ?? I'm running it on
windows, so who knows what's going on :-)
Nino