Re: [SMARTY] What das Smarty cache/compile
| From: | Andreas | Date: | Sun, 12 Jan 2003 10:15:23 +0000 |
| Subject: | Re: [SMARTY] What das Smarty cache/compile | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7131@lists.php.net to get a copy of this message | ||
Am Sam, 2003-01-11 um 19.47 schrieb M Mohr:
> Hello,
>
> On Sat, Jan 11, 2003 at 04:09:30PM +0100, akorthaus@web.de wrote:
> > Hi!
> >
> > One question:
> > I want to use smart for a DB-based page, which often changes. I think smarty
> > will compile the templates, so that the PHP-code always is parsed, and I
> > always get my actual data from database. But what about caching?
> > Does smarty cache the code so that the database isn't asked each time the
> > script is called?
> > If it does not, why is there the function "insert"?
>
> smarty compiles the template and stores it as executable php-code in
> the filesystem. it does this regardless on your caching-settings. if
> you enable caching, however, it additionally keeps the output (the
> html-code) of the template in it's cache, so that the php-code is not
> evaluated on subsequent requests to the same template. so "insert" is
> necessary when $smarty->caching==true to insert dynamic parts in the
> static cached html-code.
>
> HTH
> messju
so if I have my database-based site I should disable caching.