0
votes

Does redis update the key value and ttl if I set the same key value and ttl again before the current ttl expires? When I do so, it doesn't seem to do anything, and the keys expire after the previous set timeout. The code is pretty simple - write the same keys in redis over and over again with the same value and same ttl - but looks like I should be getting the key and setting the new ttl value instead. Is this the case?

2
Please share the code to reproduceItamar Haber

2 Answers

2
votes

It will update the value and the TTL.

enter image description here

1
votes

Does redis update the key value and ttl if I set the same key value and ttl again before the current ttl expires? ->yes, it definitely update new ttl and value for the key