【发布时间】:2015-08-10 02:09:10
【问题描述】:
我已阅读 redis config document 但找不到这样的选项。
我搜索并发现“默认情况下,密钥将永远存在”。我想急切地改变这种默认行为。
Normally Redis keys are created without an associated time to live. The key will simply live forever, unless it is removed by the user in an explicit way, for instance using the DEL command.
The EXPIRE family of commands is able to associate an expire to a given key, at the cost of some additional memory used by the key. When a key has an expire set, Redis will make sure to remove the key when the specified amount of time elapsed.
http://redis.io/commands/expire (again)
提前致谢!
【问题讨论】: