Re: [SMARTY] What das Smarty cache/compile
| From: | M Mohr | Date: | Sat, 11 Jan 2003 18:47:21 +0000 |
| Subject: | Re: [SMARTY] What das Smarty cache/compile | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7130@lists.php.net to get a copy of this message | ||
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
> kind regards
> Andreas