先上结论,一般是永不过期的。
在使用redis的时候,突然想起这个问题,然后查了下【1】,redis的缓存内容默认是永不过期的。后面如果有时间,我再仔细看下相关内容,写在这里。
后记,
在看redis文档的时候,看到了这么一句话:
Keys with an expire
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.【3】
参考资料:
【1】,redis默认过期时间:redis默认的是永不过期
【2】,Redis 内存淘汰机制
【3】,redis官方文档
本文介绍了Redis缓存默认情况下是永久存在的,除非用户明确删除。同时提到了内存淘汰机制和官方文档关于过期键的说明。

被折叠的 条评论
为什么被折叠?



