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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2008-11-14 16: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
rest.

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.

thanks
max
This topic is locked and can not be replied to.