I am using client.setex()
to create a Redis cache with an expiration time of say 3600 seconds but I also update it from time to time, and for that I am using client.set()
.
Wondering if the expiration time stays the same or gets extended by 3600 every time I update that cache.
Asked
Active
Viewed 2,265 times
1

luiquao
- 1,094
- 4
- 21
- 46
1 Answers
3
set() will remove the existing expiration time in Redis .
you can use :
client.set(key,value, "EX", client.ttl(key))
for continuing the expiration time.
for more detail :

Babak Abadkheir
- 2,222
- 1
- 19
- 46