After selecting Database one, I am able to set keys that end up propagating, but am unable to retrieve any keys with a SCAN and iterating command. I see in this previous thread that these commands have been enabled.
It’s pretty clear to me that the commands are just responding with an “ok” to everything (like mentioned in your docs).
Is there any way around this? Can I iterate through keys globally or is there some other magic to use for clearing a cache from Database one that I’m not aware of?
I already have “pull” based cache clearing set up so I can just do that.
The best “purge everything” strategy I’ve seen has been a combination of:
TTLs on keys
Cache version in key (like: cache:v2:asdf)
Push current cache version globally
“Purge” by using the new cache version for keys from your app
This is very useful when you have a tremendous number of cache entries. Scan + purge is super slow for more than a few keys, and more useful for targeting purges usually.
@kurt I need to only apply a few changes at a time. A user will update something that’s been cached, and it will only affect a handful of keys in Redis.
As changes occur, I:
Fetch them from each instance
Scan if the key pattern exists in that region’s cache
Delete them if they do.
So I think I’m inline with your best practices you just mentioned.