views:

799

answers:

3

Hi,

What's memcached's maximum key expiration time?

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

+2  A: 

If you don't provide expiration and cache get's full then the oldest key-values are expired first.

Eimantas
A: 

OK, I found out that the number of seconds may not exceed 2592000 (30 days). So the maximum expiration time is 30 days.

Fernando
No, that's not true. The number of seconds in a *duration* form may not exceed 30 days. You can specify an expiration three months out if you want to as an absolute time. You can also specify 0 to not have an expiration.
Dustin
+1  A: 

I believe you can set key expiration to a date, instead of an amount of time. The date can be more than 30 days in the future:

http://code.google.com/p/memcached/wiki/FAQ#What_are_the_limits_on_setting_expire_time?_%28why_is_there_a_30_d

Paul D. Waite