Should I instead use the ScanAllKeys(yourPattern) as suggested in the stackoverflow post from 2015, or is the implementation fixed? We are using ServiceStack 5.5
Yeah you should ScanAllKeys if you intend to use it often and your dataset (i.e. number of keys) is very large as KEYS is blocking.
I’ve also just replace our internal usage of KEYS with ScanAllKeys in this commit so it uses the less server-blocking alternative at the expense of potentially more network requests.
If you want to use it now, this change is available from v5.6.1 that’s now available on MyGet.
One other thing that would be great: Let IRedisClient extend IRemoveByPattern - then it will be easier to build tests and injecting a mock of IRedisClient to a component (currently I do a workaround by having a ICacheFake mockable Interface in our tests). This is not critical however: