I have some keys with TTL in redis. So, normally the key will be evicted when the TTL passed.
But what I want to do is, in every access (retrieval) to the key, I will want to reset the TTL to the original value I set earlier.
For example: I have set 2 hours for a key. After 1 hour later, the key is accessed. I want to set the TTL to 2 hours again at that time. So, the key will only be evicted if it’s not accessed in its TTL lifetime.
How to do this efficiently?