memcache flush issue

by Guna 2012-07-11 11:13:09

Hi,

You can use flush() method to make all items expire in memcache. But you've to wait at least one second after flush() command before further actions like repopulating the cache.

Otherwise new items < 1 second after flush() would be invalidate instantly.

for ex:

$memcache->flush();

$time = time()+1; //one second future
while(time() < $time) {
//sleep
}
$memcache->set('key', 'value'); // repopulate the cache

Tagged in:

2925
like
0
dislike
0
mail
flag

You must LOGIN to add comments