0

PHP Memcached を使用しています。キーを削除しても、キーを取得できます。私は何が間違っているのでしょうか?

function __construct() {
    $this->_cache = array();

    // if we have memcache support, load it from CACHE_POOL
    //
    if (class_exists('Memcached')) {
        $this->_mc = new Memcached('CACHE_POOL');
        $servers = $this->_mc->getServerList();
        if (empty($servers)) {
            //This code block will only execute if we are setting up a new EG(persistent_list) entry
            $this->_mc->setOption(Memcached::OPT_RECV_TIMEOUT, 1000);
            $this->_mc->setOption(Memcached::OPT_SEND_TIMEOUT, 3000);
            $this->_mc->setOption(Memcached::OPT_TCP_NODELAY, true);
            $this->_mc->setOption(Memcached::OPT_PREFIX_KEY, "md_");
            $this->_mc->addServers(self::$_MEMCACHE_IPS);
        }

        $current_cache = $this->_mc->get(self::CACHE_KEY);

        if ($current_cache) {
            $this->_cache = array_merge($this->_cache, $current_cache);
        }
    }

}

    function delete($key) {
        self::instance()->_mc->delete($key);
    }

    function getSafe($key) {
        return isset($this->_cache[$key]) ? $this->_cache[$key] : FALSE;
    }

self::instance()->delete("test");
echo(self::instance()->getSafe("test"));

これを実行した後でも、get は値を返します。ここで何が起こっているのかわかりません。

4

1 に答える 1