Re: [SMARTY] cache+dynamic site - i don't get it...

From: Date: Thu, 02 May 2002 05:45:01 +0000
Subject: Re: [SMARTY] cache+dynamic site - i don't get it...
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3972@lists.php.net to get a copy of this message
I split the page template in several (sub-)template, control caching at the main program (before displying the sub-template), and use the include_php() trick into the specific sub-template (where the db calls go). In this manner, I can avoid the is_cached control. HTH /gp Monte Ohrt wrote:
That is what is_cached is for. you put is_cached around your db calls. If the page is cached, then don't execute the db calls. Monte k wrote: [SNIP]
1. gather data from database(s), put it in arrays, etc. 2. assign data to Smarty/template variables [assign()] 3. use display() to send the html out. My question: if I turn caching on, the 1st step above (get data from mysql database, put it in arrays, etc) will still be executed? (My goal is to run this part only once, only when data has changed.) If it's still executed, how sould I write the code, to avoid redundant db access? [SNIP]
-- Discussion: How do you feel about Open Source firms making millions through public offerings? "I wish these companies were making the same millions without distributing any non-free, user-subjugating software." -- Richard Stallman "We're so forward that sometimes we reach ourself." -- g.p. "It is amazing how much you can achieve when you don't have to do the real work yourself." -- Joe Celko Gian Paolo Ciceri Via B.Diotti 45 - 20153 Milano MI ITALY I2BITM @ Cofiri mobile : ++39 347 4106213 : ++39 329 8103661 eMail : gp.ciceri@acm.org, gp.ciceri@computer.org : gp.ciceri@cofiri.it webSite: http://www.cofiri.it (forecoming) ICQ # : 94620118

« previous php.smarty.general (#3972) next »