redis 過期時間

papering發表於2024-09-29

EXPIRE | Docs https://redis.io/docs/latest/commands/expire/

The EXPIRE command supports a set of options:

  • NX -- Set expiry only when the key has no expiry
  • XX -- Set expiry only when the key has an existing expiry
  • GT -- Set expiry only when the new expiry is greater than current one
  • LT -- Set expiry only when the new expiry is less than current one

A non-volatile key is treated as an infinite TTL for the purpose of GT and LT. The GT, LT and NX options are mutually exclusive.

相關文章