Short answer: no, and you do not want to do this.
The dalli driver and memcached support the removal of several keys with one command from the box and for good reason. Because memcached locates cached values by hashing a key in a production environment with multiple cache nodes, the delete_matched operation should scan all nodes that look for keys that could potentially match. This defeats the key goal of memcached , which is performance.
There are several implementations that extend dalli and promise to provide a deleted_matched implementation. They all seem to be a compromise for the convenience of programmers, so use them with caution. A look at the sources of these gems before using them is a good start.
Related Questions Can I get / find Memcached keys with a prefix?
source share