by blutack · 4y ago · 0 comments
Maybe you could store the related keys in a hash or something?
I'm also guilty of trying to use features in redis in ways they weren't really designed for - it's such a fantastic bit of technology that a lot of the time you can still get away with it but it's not redis's fault when it doesn't work!
One hack I can think of is, accessing the keys. If the key is expired, then Redis won't provide it and you could know it is expired.
Another way is to club all of the relative keys in a hash [1]
[0] - https://redis.io/commands/expire#how-redis-expires-keys
sorry should have been more clear
There is also a "passive" key expiry where any read to a key will check the expiry time and delete the key if the current time is larger than the expiry time.
Why are you assuming that? And if true, why do you think that assumption will hold in the future????? Redis could always tweak or change the behavior.