views:

260

answers:

1

I'm trying to use Memcached and wondering if there is a way to remove the objects from the cache by key pattern rather than just one key per object.

Say, I cache user 1 with key "user1", then user 2 with key "user2" ..., is there a way to remove all objects with a key that starts with "user"? Or is there a way to get an enumerator from it and loop through the keys?

To be complete, I'm using the enyimmemcached library at http://enyimmemcached.codeplex.com/ on a Asp.net app.

Thank you,

Ray.

+1  A: 

Have a look at memcached-tag, which allows you to give all of those the same tag, and take them out at once.

Chad Birch
Do you know if enyimmemcached supports it? that is the c# client lib I use.
ray247
I'm not sure, you may have to modify enyimmemcached as well to be able to support the tagging operations, I will look around a bit.
Chad Birch