Memcached - clear all keys matching a pattern?

M

Max Williams

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top