cachette icon indicating copy to clipboard operation
cachette copied to clipboard

💨 Expose Get keys from RedisCache

Open ElicNg opened this issue 1 year ago • 1 comments

Problem

Having access to the list of keys is important in cases where we want to manipulate the cache such as deletes based on a pattern.

Solution

Exposing keys function from Redis allow us to find keys matching a certain pattern, thus allowing the dev to seek and delete expected caches.

Potential issue

Get Keys is O(n), n is the number of keys in cache and locks the instance while looping through all items. A potential solution is to use SCAN instead. But in this case, it will only be used in connectors which won't have a lot of cached items.

ElicNg avatar Feb 06 '24 20:02 ElicNg

P.S. I removed some internal informations from the description. If you need more information, please ping me.

ElicNg avatar Feb 06 '24 21:02 ElicNg