note 120186 added to memcached.expiration
| From: | valugi at gmail dot com | Date: | Fri, 18 Nov 2016 23:48:55 +0000 |
| Subject: | note 120186 added to memcached.expiration | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-207159@lists.php.net to get a copy of this message | ||
The fact that one sets an expiration time does not mean that the keys will expire at that particular
time. I'm not sure what is happening in the background, if there is a process like a garbage
collector that expire keys, but some function do not activate the expiration check and return the
key as valid, for example
getAllKeys is not atomic and returns even expired keys.
$memcached = new Memcached();
$memcached->set('key','value',10);
//waiting more than 10 sec
sleep(20);
$data = $memcached->getAllKeys();
var_dump($data); // key will still be listed
$key = $memcached->get('key'); // will trigger the expiration
----
Server IP: 195.139.129.18
Probable Submitter: 109.48.121.37
----
Manual Page -- http://php.net/manual/en/memcached.expiration.php
Edit -- https://master.php.net/note/edit/120186
Del: integrated -- https://master.php.net/note/delete/120186/integrated
Del: useless -- https://master.php.net/note/delete/120186/useless
Del: bad code -- https://master.php.net/note/delete/120186/bad+code
Del: spam -- https://master.php.net/note/delete/120186/spam
Del: non-english -- https://master.php.net/note/delete/120186/non-english
Del: in docs -- https://master.php.net/note/delete/120186/in+docs
Del: other reasons-- https://master.php.net/note/delete/120186
Reject -- https://master.php.net/note/reject/120186
Search -- https://master.php.net/manage/user-notes.php