tollmanz/wordpress-pecl-memcached-object-cache — pull request #49 by webaware (2014-11-14 02:44:23+00:00)
Title: Add faux-flush support

When multiple websites share a single Memcached instance, it's bad form to allow one site to flush the entire Memcached cache. Also, `flush_all` can be disabled to prevent just this situation.

> Better an empty room, than a bad tenant!

This PR adds faux-flush support through a generated salt that is replaced each time `wp_cache_flush()` is called. The `delay` parameter is ignored, and all items for the current website config are essentially "forgotten" because they can no longer be retrieved. They'll eventually be evicted either due to expiry or for memory reclamation based on LRU.

Faux-flush is enabled by defining the constant `WP_CACHE_FAUX_FLUSH` as truthy. This allows the drop-in to continue functioning as it currently does, unless specifically configured to use faux-flush.

An admin menu item is added to the Tools menu, allowing admins to request a faux flush at any time. As a developer, this makes my life much easier :) and can resolve problems that might otherwise require either a support request to the website host, or editing `wp-config.php` to change `WP_CACHE_KEY_SALT` (what I've been doing up until now).