Memcache maximum key expiration time

前端 未结 7 1133
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 03:45

What\'s memcached\'s maximum key expiration time?

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

7条回答
  •  被撕碎了的回忆
    2020-12-05 04:28

    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:

    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.

    https://github.com/memcached/memcached/wiki/Programming#expiration

    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.

提交回复
热议问题