Memcache::flush

(PECL memcache >= 1.0.0)

Memcache::flush — Flush all existing items at the server

Description

boolMemcache::flush
( void
)

Memcache::flush() immediately invalidates all
existing items. Memcache::flush() doesn't
actually free any resources, it only marks all the items as expired, so
occupied memory will be overwritten by new items.
Also you can use memcache_flush() function.

User Contributed Notes 2 notes

Please note that after flushing, you have to wait a certain amount of time (in my case < 1s) to be able to write to Memcached again. If you don't, Memcached::set() will return 1, although your data is in fact not saved.