A key with an absolute deadline branches into two command paths. GET, INCR and SET KEEPTTL keep that same deadline; plain SET clears it and leaves TTL -1. Reads do not renew the deadline.

Redis TTL lets every key carry its own clock

Redis expiration answers when a key should stop being available, not how much memory the server may consume. A deadline belongs to the key, and later commands can preserve, replace, or remove it. Reliable TTL use therefore requires testing update paths as well as the initial insertion. A successful write alone says nothing about the deadline remaining afterward. ...

June 29, 2027 · 6 min · XB Field Notes