Re: [SMARTY] Cache groups problem

From: Date: Wed, 19 Feb 2003 14:32:36 +0000
Subject: Re: [SMARTY] Cache groups problem
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7878@lists.php.net to get a copy of this message
You have to supply a group name when you call display() to put the templates into a group. Then you can remove them by that group. Monte On Wed, 2003-02-19 at 07:27, Katana wrote: > Hello, > > I have a gallery tool that uses Smarty and implements caching for > every page. > > Everything works perfectly, but now I need to clear the cached > versions for a specific galery when an image is deleted. > I have 3 different pages: > - galeries/index.php?page=X > lists the galeries (with one thumbnail taken from each galery) > - galeries/view.php?galerie=X&page=Y > shows the thumbnails in the galery, with 8 images per page > - galeries/view_details.php?galerie=X&image=Y > shows an image in full size > All these pages display the template galeries/main.php which > includes galeries/index.php or galeries/view.php and so on. > The caching works correctly. > > I'm attempting to use cache groups the following way: > - for index.php: > $cache_id = "galeries/index.pp|$page"; > - for view.php: > $cache_id = "galeries/view.php|$id_galerie|$page"; > - for view_details.php: > $cache_id = "galeries/view_details.php|$id_image"; > > and > $tpl->display('galeries/main.php', $cache_id) > for every page > > In my administration interface, when an image is deleted, i > execute the following code: > > $tpl->caching = true; > $tpl->clear_cache('galeries/main.php', 'galeries/index.php'); > $tpl->clear_cache('galeries/main.php', "galeries/view.php|$id_galerie"); > $tpl->clear_cache('galeries/main.php', > "galeries/view_details.php|$id_image"); > $tpl->caching = false; > > But it looks like the cached versions are not deleted... > > What do I need to check to make it works ? Any clue ? > > Katana -- Monte Ohrt <monte@ispi.net>

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