Forum: Ruby Memcached - clear all keys matching a pattern?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Max W. (Guest)
on 2008-11-14 17:58
I have some pages that serve up a massive tree of html, with a few
different varieties used on different pages.  Generating the html is
quite intensive so I use memcached to store the different flavours,
generating a different key for each flavour.

When the tree contents change, i need to clear these keys out of
memcached so they will be re-generated next time someone goes to the
pages.  So far i've been flushing everything with CACHE.flush
(CACHE.flush_all locally) but it would be better to just flush the
relevant keys.  Since the key names are also subject to change, but all
contain the fragment "property_tree" in their names, ideally i would
like to drop all keys matching against /property_tree/ and leave the

Is there a way to do this?  I can't see any way of getting memcached to
tell me all of it's saved keys.

This topic is locked and can not be replied to.