Caching pages with {include} tags
| From: | Mikolaj Rydzewski | Date: | Fri, 12 Sep 2003 14:34:01 +0000 |
| Subject: | Caching pages with {include} tags | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10196@lists.php.net to get a copy of this message | ||
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.
--
Mikolaj Rydzewski
Becomo S.A.