美文网首页
如何设置redis的过期策略

如何设置redis的过期策略

作者: lifefruity | 来源:发表于2021-04-23 11:07 被阅读0次

    在redis.conf中有如下配置

    # volatile-lru -> remove the key with an expire set using an LRU algorithm
    # allkeys-lru -> remove any key according to the LRU algorithm
    # volatile-random -> remove a random key with an expire set
    # allkeys-random -> remove a random key, any key
    # volatile-ttl -> remove the key with the nearest expire time (minor TTL)
    # noeviction -> don't expire at all, just return an error on write operations
    

    选择自己想要的关闭注释就行

    相关文章

      网友评论

          本文标题:如何设置redis的过期策略

          本文链接:https://www.haomeiwen.com/subject/vakcrltx.html