Re:[BEGINNER] Question about caching
| From: | Andrei Zmievski | Date: | Fri, 28 Dec 2001 14:06:14 +0000 |
| Subject: | Re:[BEGINNER] Question about caching | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2402@lists.php.net to get a copy of this message | ||
On Fri, 28 Dec 2001, Brian E. Lozier wrote:
> If you're using exactly one template per page, you just use this:
>
> $tpl->display('yourtemplate.tpl', $REQUEST_URI);
>
> And it will display the cached page.
>
> But remember you need to go back and test to see if it's cached before performing all your
> db calls, action,
> etc.
>
> So you need:
>
> if(!$tpl->is_cached('yourtemplate.tpl', $REQUEST_URI)) {
> // do all your page logic here
> }
>
> $tpl->display('yourtemplate.tpl', $REQUEST_URI);
>
> The whole method seems to break as soon as you start using ->fetch(), though.
What do you mean? Any short examples?
-Andrei
"Everything has its wonders, even darkness and silence, and I learn,
whatever state I may be in, therein to be content." - Helen Keller