SET a 100
EXPIRE a 86400
OK, right now, “a” will expire within a day. I want SET “a” to other values, but I still want it to expire based on the initial “EXPIRE” that I created.
In other words, don’t remove the EXPIRE when I set “a” to something new.
If you’re doing this from the command line, you can’t do it precisely. The best you could do is to manually set the new key’s expire time as
a‘s remaining TTL (TTL a).If you’re communicating with Redis from a program you could probably fetch
a‘s expire time and set that value as the new key’s expire time fast enough to be precise.