Re: Please help on caching

From: Date: Thu, 27 Dec 2001 11:34:09 +0000
Subject: Re: Please help on caching
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2385@lists.php.net to get a copy of this message
At 04:06 PM 12/26/01 -0800, you wrote:
I have queried this list quite a few times but nothing is helping. I upgraded to the latest version. I have tried all suggestions. Is this a bug in Smarty? Does anyone else have this "dynamic" content caching correctly using the cache_id? Because Smarty is just ignoring my cache_id I pass, no matter what it is. Please, I really need to get this working, it's important.
I have it working with Smarty 1.4.5 - see it in action at <http://casualties.commemoratewtc.com> where each page is cached for 3 days.
Here is my 'main.tpl' which is the main layout of the site (note I replaced > and < with ] and [ because my email program strips the HTML for some reason): main.tpl: [html] [head][title]{$PageTitle}[/title][/head] [body] {$Content} [/body] [/html]
Great - another coder who hates header/footer files and prefers the design to be in one file! That now makes two of us for whom the "normal" smarty method doesn't suit :-)
I have tried passing both $REQUEST_URI (which *is* passing correctly, I verified!) and $catID (since it's unique for each of the cache results I'm looking for) to main.tpl like: $tpl->display('main.tpl', $REQUEST_URI); // and: $tpl->display('main.tpl', $catID); I've also tried passing it to the $tpl->fetch() where I get the actual files.tpl template like: $tpl->assign("Content", $tpl->fetch('files.tpl', $REQUEST_URI));
This is the right one. After this, just call $tpl->display('main.tpl'); and it should work. You could always try $tpl->display('main.tpl', $REQUEST_URI); as well. Did you clear the cache and the compiled templates before you tried this? Sorry I can't be more help. Peter. -- Maple Design - http://www.mapledesign.co.uk

« previous php.smarty.general (#2385) next »