Defvayne23

 

Saturday Mini Tip: Memcache flush

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:

1
2
3
4
5
6
7
 $oMemcache->flush();
 
// Wait for memcache to finish flushing
$time = time()+1; //one second future
while(time() < $time) {
//sleep
}

You can find more info here.

  • Share/Bookmark

 

Leave a Reply

blog comments powered by Disqus