Re: [SMARTY] Caching pages with {include} tags
| From: | messju mohr | Date: | Fri, 12 Sep 2003 14:50:10 +0000 |
| Subject: | Re: [SMARTY] Caching pages with {include} tags | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10198@lists.php.net to get a copy of this message | ||
On Fri, Sep 12, 2003 at 04:34:01PM +0200, Mikolaj Rydzewski wrote:
> Hello,
>
> Here's the situation:
>
> Every page on my site is generated using one, general index.tpl
> temaplate. Depending on the actual page I include other templates, i.e.:
>
> index.tpl:
> ...
> <body>
> <h1>Welcome</h1>
> {include file="$content"}
> </body>
> ...
>
> It looks for me much nicer, than to include headers,footers in every
> template.
>
> But now caching comes. I will have to use cache_id (with value of
> $content variable), and also some sort of sub_id (or cache groups)
> depending on parameters, logged user, etc.
>
> I wonder how efficient would it be. Or, in other words: what is better:
> don't change anything, just use unique cache id and cache groups; or
> change every template not to use one, global index.tpl.
i'd keep the single index.tpl if you like that structure.
once the page is cached there is only one cached-page-file regardless
on the number of includes it contains. i don't think there is that
much difference in a distinct templates-name (each with sub_ids) or a
distinct primary cache_id (each with subids)
> --
> Mikolaj Rydzewski
> Becomo S.A.