Cache groups problem
| From: | Katana | Date: | Wed, 19 Feb 2003 13:27:11 +0000 |
| Subject: | Cache groups problem | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-7863@lists.php.net to get a copy of this message | ||
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