Search code examples
redisttl

redis updating a key with the same value and ttl


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?


Solution

  • It will update the value and the TTL.

    enter image description here