Re: [SMARTY] compiling vs. caching
| From: | olinux | Date: | Fri, 18 Apr 2003 23:10:46 +0000 |
| Subject: | Re: [SMARTY] compiling vs. caching | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9330@lists.php.net to get a copy of this message | ||
correct :)
think of compiling as converting your 'smarty code' to
php i.e. "{$something}" becomes "echo $something;"
look in your templates_c directory and you will see
the php output. If your website is serving a couple
thousand pageviews per day and your template changes,
say every week there's no point in compiling it evey
time a page is requested. Likewise, if you've post
articles to a database, why make php connect and
retrieve the same article over and over.
olinux
--- Eric Ocean <eric@masterpiece-ag.com> wrote:
> There is a difference between these two things,
> isn't there?
>
> My understanding (please correct me if I'm wrong) is
> that template
> compiling makes it faster for Smarty, the object, to
> read in a
> template. It does not affect, in any way, the output
> from the template.
>
> Template caching, on the other hand, caches the
> output from evaluating
> the template at a particular point in time. Since
> subsequent
> evaluations of the template will actually just
> return the output from
> the cached evaluation, the content returned could be
> "stale". It is up
> to the user to determine how stale is too stale.
>
> The insert function allows you to have dynamic
> content even when
> template caching is turned on. Thus it's a way to
> get the benefits of
> template caching for all of your static content,
> while still retaining
> the ability to generate some things dynamically on
> each page load.
>
> Thanks,
>
> Eric Ocean
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com