Skip to content

Glossary: Redis and Caching

Expiry commands (EXPIRE, PERSIST, KEEPTTL)

Also written: EXPIRE, PEXPIRE, EX, PX, PERSIST, KEEPTTL

`EXPIRE` gives an existing key a lifetime in seconds (`PEXPIRE` in milliseconds), and `EX`/`PX` on `SET` do the same while saving. `PERSIST` removes a TTL so the key stays forever, and `SET ... KEEPTTL` overwrites a value without clearing its TTL, which a plain `SET` would.

Where the book teaches it

Related terms

TTL (time to live)Jitter