What is the maximum length in seconds to store a value in memcache

Posted by Emilien on Stack Overflow See other posts from Stack Overflow or by Emilien
Published on 2010-05-08T08:03:56Z Indexed on 2010/05/08 8:08 UTC
Read the original article Hit count: 315

Filed under:
|

The Google App Engine memcache documentation states that the time parameter of memcache.set() is an "Optional expiration time, either relative number of seconds from current time (up to 1 month), or an absolute Unix epoch time."

So I tried to set a value for 30 days, which according to Google is 2 592 000 seconds.

However, I highly suspect that this value is too high, because the value was set (memcache.set() returned the value True), but a memcache.get() just after always returned None. Reducing this value to 1 728 000 seconds just worked fine/as expected.

I guess that once passed the highest value, the time parameter gets interpreted as an absolute Unix epoch time. That would mean that 2 592 000 seconds got interpreted as "Sat, 31 Jan 1970 00:00:00 GMT", which is obviously a date in the past...

So what is the highest value you can enter that will get interpreted as a number of seconds in the future?

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about memcache