Re: [SMARTY] compile all templates at once
| From: | Robert Amos | Date: | Tue, 17 Aug 2004 18:38:55 +0000 |
| Subject: | Re: [SMARTY] compile all templates at once | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11704@lists.php.net to get a copy of this message | ||
On Tue, 17 Aug 2004 10:41:21 -0400, Daniel Cummings <dan@dbmscan.com> wrote:
> On 8/17/04 7:23 AM, "messju mohr" <messju@lammfellpuschen.de> wrote:
>
> > On Tue, Aug 17, 2004 at 09:12:32PM +1000, Robert Amos wrote:
> >>> This will work just fine for templates that are not influenced by GET or
> >>> POST requests. But, for GET/POST "pre-caching/pre-compiling" you should
> >>> look at a tool like curl or better, wget.
> >>
> >> Most smarty templates shouldnt be affected by GET/POST requests at
> >> compile time, as that only affects what comes out of the templates at
> >> runtime. If you're only looking to compile the templates into PHP
> >> code, theres nothing wrong with calling fetch() in a loop. Its only if
> >> you're caching that you need to think about output.
> >
> > yes. i forgot to mention you should set $smarty->caching=false in your
> > recompile-all-templates-script regardless if you use caching on the
> > real site or not.
>
> Thanks for the clarifications, guys...
>
> However, if you use multiple compile_ids (e.g., one per client based on
> login info) it *would* have an impact, right?. That's the way I work with
> compiled scripts because I need to be able to update/clear one client's code
> base without affecting the others.
>
> Am I correct in this approach? Or am I making work for myself?
>
That really depends on the nature of your scripts. If the compiled php
source itself will change according to the user details, then its
fine, however if the source stays the same and the input/output mearly
changes based on assigned information (as happens 99% of the time)
then having multiple compiled copies would just waste disk space +
time and you could probably just set a cache_id.
The rule doesn't hold true always though, so unless you've got a
thousand templates wasting disk space, you're better off sticking with
what works :)
-bok