note 81420 modified in function.memcache-flush by danbrown

From: Date: Sat, 19 Jun 2010 14:27:41 +0000
Subject: note 81420 modified in function.memcache-flush by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170291@lists.php.net to get a copy of this message
From the memcached mailing list: "The flush has a one second granularity. The flush will expire all items up to the ones set within the same second." It is imperative to wait at least one second after flush() command before further actions like repopulating the cache. Ohterwise new items < 1 second after flush() would be invalidatet instantaneous. Example: <?php $memcache->flush(); $time = time()+1; //one second future while(time() < $time) { //sleep } $memcache->set('key', 'value'); // repopulate the cache ?> --was-- More detail on the previous issue (from the memcached mailing list): "The flush has a one second granularity. The flush will expire all items up to the ones set within the same second." It is imperative to wait at least one second after flush() command before further actions like repopulating the cache. Ohterwise new items < 1 second after flush() would be invalidatet instantaneous. Example: <?php $memcache->flush(); $time = time()+1; //one second future while(time() < $time) { //sleep } $memcache->set('key', 'value'); // repopulate the cache ?> http://php.net/manual/en/function.memcache-flush.php

« previous php.notes (#170291) next »