quick way to clear memcache

useful to clear memcache when debugging especially when we have applications running on it.

In php,


$memcache_obj = new Memcache;
$memcache_obj->connect('localhost', 11211);
$memcache_obj->flush();

In unix,

echo “flush_all” | /bin/netcat -q 2 127.0.0.1 11211

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.