Let's assume I have these variables saved in apc, memcached and eaccelerator:
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) ?
is there any way to list the cached variables ?
The slow solution
For APC:
For eaccelerator:
For memcached, look at @rik's answer
The proper solution
The general solution for expiring multiple keys at once is to namespace them. For expiring them, you just have to change the namespace:
Say you have a group of keys "article_3_1", "article_3_2", .... You can store them like this:
Fetch them like this:
And expire them all by just incrementing the namespace: