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

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@sdpfoue
Copy link

sdpfoue commented Feb 4, 2014

per expire in both php memcache or memcached:
http://www.php.net/manual/en/memcache.set.php
http://www.php.net/manual/en/memcached.expiration.php

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+=time();
else
$expire=0;
$expire = max(0, $expire);

This comment has been minimized.

@samdark

samdark Feb 5, 2014

Member

Please use tab instead of spaces.

@samdark

This comment has been minimized.

Copy link
Member

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