Well, memcache uses an identity pattern. You check your cache, then fall into your database (or something else that you are using). You can find information about the source by saving objects, not just values, but for this you will get a performance hit.
In fact, you cannot request a cache that it contains as a list. For mass invalidity, you will need to save the list of what you have enclosed and repeat it, or you will have to sort through all possible keys that may correspond to the problem you are interested in. The resource you specify, memcache-tag, can simplify this, but it does not seem to be supported by the memcache project built-in.
So, your options are now iterative deletions or completely flush out everything that is cached. So I suggest considering design, this is a question you should ask. To get a useful answer for you, I ask: why do you want to do this?
source share