eliminating memcached's 30-day limit

后端 未结 2 1965
日久生厌
日久生厌 2021-01-12 18:25

Why does memcached impose a 30-day limit on the lifetime of cache entries?

In my system, I am always setting the lifetime to be 30 days, since that\'s the max allowe

2条回答
  •  抹茶落季
    2021-01-12 18:44

    30 days is the maximum length of time for which you can specify an expiry, but if you're thinking of eliminating the expiry check altogether, would it not be simpler to set the expiry time to 0? This should mean that the data is stored until the cache is full and it's removed to allow for insertion of newer items.

    From the PHP Memcache docs:

    Parameter expire is expiration time in seconds. If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, it could be deleted from the cache to make place for other items).

提交回复
热议问题