Re: [SMARTY] Benchmarking cache and inserts
| From: | pt2002 | Date: | Wed, 11 Jun 2003 18:16:27 +0000 |
| Subject: | Re: [SMARTY] Benchmarking cache and inserts | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9698@lists.php.net to get a copy of this message | ||
Hi
could you provide a little sample of your approach?
Greetings
"Wom.Bat" <wom.bat@gmx.net> escreveu na mensagem
news:00c101c32cda$2ea083f0$0201a8c0@WOMBAT...
> hm...
> I somehow have the impression that I am the only human being on this nice
> planet who's using the following approach:
>
> index.tpl, called by index.php or whatever, NOT cached
> it includes other applications (menu, content, ads etc) via include_php
> these applications use caching
>
> that's a very fast solution (you just have to be careful what to put into
> your index.tpl), and you have no hassle with inserts (which are REALLY
> slow!)
>
> just my 1.99 cents,
> David
>
> > 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:
> > >
> > >
> > >>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
> > >
> > >
> >
> > --
> > .::....::.:...::...:..:.:::..:..::..::.::..:.:.
> >
> > 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.biz
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>