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
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).
30 days is the limit at which we consider the time you specified to be a TTL from now.
If you want longer than 30 days, it's fine, just use an absolute time (time() + whatever
).
If you want no time-based expiration, as ConroyP says, just use 0
.