Saturday Mini Tip: Memcache flush

Feb 20, 2010
Tags: PHP and Saturday Mini Tip

Memcache can be great to store variables, but beware of Memcache::flush. The function actually requires about 1 second to finish. Below is the best way to handle it:


// Wait for memcache to finish flushing
$time = time()+1; //one second future
while(time() < $time) {

You can find more info here.