Get all items in cache

I recently got Enyim Memcached and it works great. Using the library, I can store and retrieve items without problems.

However, I was wondering if there is a way to extract all the elements from the cache. I know that you can get an element by its key:

  MemcachedClient client = new MemcachedClient() object o = client.Get("key"); 

But I don’t see what GetAll() or a similar method looks like, am I missing something?

+4
source share
2 answers

I want to talk in detail about the answer of Dasun. He is right that there is no way to get all the keys from standard memcached, however there are other memcached options that allow you to do this through tap streams. This can be done if you use the Membase server (if you just use the Membase cache, most likely only memcached), or you can use the membached branch for Membase, which can be found here https://github.com/membase/memcached . The Membase branch is definitely safe to use, and many of the best memcached developers work for Membase (now Couchbase) and bring material from this branch back to the main memcached branch.

On the other hand, the Enyim client does not support the API, but there is a Java, C / C ++, python and ruby ​​client that support the crane. What would you do is create a tap dump stream, and that stream will send you all the memcached / Membase key value pairs.

+6
source

No, you can not. Memchached is not intended for this purpose (caching is not intended to retrieve the entire item, which is pointless).

+2
source

All Articles