eko/gocache

Can I get all cached entities?

holenlv opened this issue · 1 comments

I want to foreach all cached entities, Is there a solution?

eko commented

Hi,

Unless most of cache stores are key/value ones, this cannot be done.

Gocache only brings an interface to all stores but nothing is stored in memory.

In your case, you should keep a key containing all the keys you wrote in your store in order to be able to retrieve them all. Using Redis you can use sets for this.

Hope it helps. Closing this as there is no issue with gocache library here.