memcache flush issue
by Guna[ Edit ] 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