开发者

delete cache by name in cache_lite

开发者 https://www.devze.com 2023-02-06 05:37 出处:网络
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

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 i开发者_JS百科n other words , how can i list the cached variables ??


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号