Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具

Redis 过期时间问题

Redis 评论 1 大约 637 字

Redis 过期时间问题

The timeout will only be cleared by commands that delete or overwrite the contents of the key, including DEL, SET, GETSET and all the *STORE commands. This means that all the operations that conceptually alter the value stored at the key without replacing it with a new one will leave the timeout untouched. For instance, incrementing the value of a key with INCR, pushing a new value into a list with LPUSH, or altering the field value of a hash with HSET are all operations that will leave the timeout untouched.

  • del/set/getset和所有*store的命令会清除过期时间,变为-1
  • incr/lpush/hset等操作,过期时间保持原状


阅读 2290 · 发布于 2019-04-08

————        END        ————

Give me a Star, Thanks:)


  • fHLvlxbf 1楼
    Chrome | Windows 10 2023-07-24
随便看看 换一批