Reputation: 4773
lets assume i have these variables saved in cache_lite :
article_1_0
article_1_1
article_3_2
article_3_3
article_2_4
How can i delete all cached variables that starts with article_3_ (they can reach up to 10000) ?
or in other words , how can i list the cached variables ??
Upvotes: 2
Views: 249
Reputation: 1263
Try to save your cache_lite variables by specifying group value then try to clean it in by specifying that group value i.e:
$cache->save($dataarticle_1_0,"article_1_0","article_1");
$cache->save($dataarticle_1_1,"article_1_1","article_1");
$cache->save($dataarticle_3_2,"article_3_2","article_3");
$cache->save($dataarticle_3_3,"article_3_3","article_3");
$cache->save($dataarticle_2_4,"article_2_4","article_2");
Then to delete all cached variables that starts with article_3_ you can do this way
$cache->clean("article_3");
Hope this is the solution
Upvotes: 2