Re: [SMARTY] Benchmarking cache and inserts
| From: | alex =) | Date: | Sat, 07 Jun 2003 09:11:21 +0000 |
| Subject: | Re: [SMARTY] Benchmarking cache and inserts | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9676@lists.php.net to get a copy of this message | ||
I don't really understand what the whole hassle is about. I have a very
scalable and fast CMS based all around smarty and caching. I use the
insert function for banners and dynamic image rotation only, and none of
my pages takes longer than 0.06-0.09 seconds to render, that is from
scratch, and if called from cache directly, then the time falls down to
0.035-0.04. I find caching a very elegant solution, but one should not
overdo it, since in some cases it doesn't really bring much except for
flooding your host.
Nino Katic wrote:
On Fri, 6 Jun 2003, Paul Lockaby wrote:-- .::....::.:...::...:..:.:::..:..::..::.::..:.:. Kulikov Alexey - E-Com Development Consultant +43 699 1 9228792 | alex@inses.biz -- .::....::.:...::...:..:.:::..:..::..::.::..:.:. Kulikov Alexey - E-Com Development Consultant +43 699 1 9228792 | alex@inses.bizAlrighty, 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)) {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// ... code ...} $smarty->cache_lifetime = 600; // cache for 10 minutes return $smarty->fetch($template, $cacheid); }