delete cache by prefix in apc / memcache / eaccelerator
问题 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 ? 回答1: The slow solution For APC: $iterator = new APCIterator('user', '#^article_3_#', APC_ITER_KEY); foreach($iterator as $entry_name) { apc_delete($entry_name); } For eaccelerator: foreach(eaccelerator_list_keys()