Memcache最大密钥到期时间

编程入门 行业动态 更新时间:2024-10-25 00:31:45
本文介绍了Memcache最大密钥到期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

memcached的最大密钥到期时间是多少?

What's memcached's maximum key expiration time?

如果我没有提供过期时间并且缓存已满,会发生什么?

If I don't provide an expiration time and the cache gets full, what happens?

推荐答案

您可以通过提供Unix时间戳(而不是几天)来将密钥过期设置为日期.该日期可能会超过30天:

You can set key expiration to a date, by supplying a Unix timestamp instead of a number of days. This date can be more than 30 days in the future:

到期时间以无符号整数秒为单位指定.可以将其设置为0(表示永不过期")到30天(60 * 60 * 24 * 30).任何高于30天的时间都将被解释为Unix时间戳日期.如果您想在明年1月1日使某个对象过期,请按照以下步骤进行操作.

Expiration times are specified in unsigned integer seconds. They can be set from 0, meaning "never expire", to 30 days (60*60*24*30). Any time higher than 30 days is interpreted as a unix timestamp date. If you want to expire an object on january 1st of next year, this is how you do that.

github/memcached/memcached/wiki/Programming#expiration

但是,如您所说,如果您要进行设置密钥有效期为一定的时间而不是日期,最长为259.2万秒,即30天.

But, as you say, if you’re setting key expiration to an amount of time rather than a date, the maximum is 2,592,000 seconds, or 30 days.

更多推荐

Memcache最大密钥到期时间

本文发布于:2023-11-17 08:13:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609427.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密钥   时间   Memcache

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!