New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change memcache expire time #3201

wants to merge 1 commit into
base: master


None yet
2 participants
Copy link

sdpfoue commented Feb 4, 2014

per expire in both php memcache or memcached:

This parameter means expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).

It's just how the memcached deal with this parameter. Please refer memcached.c from memcached source code. Function realtime

Currently it changes all the expire time to a absolute unix timestamp, and cannot set a relative time on memcached server. If the time on app server and memcached server differed a lot (one or both running on wrong time) will lead something unwanted.

$expire = max(0, $expire);

This comment has been minimized.


samdark Feb 5, 2014


Please use tab instead of spaces.


This comment has been minimized.

Copy link

samdark commented Feb 5, 2014

Currently it uses the most precise method while allowing convenient relative time values. It is assumed that servers are synced (that's actually should be the case for all well-configured servers).

@samdark samdark closed this Feb 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment