private function storeOptionsInCache() 
    {
        $endpoints = $this->_values[self::OPTION_ENDPOINT];
        $numberOfEndpoints = count($endpoints);

        if ($numberOfEndpoints <= 1) {
            return;
        }

        // now try to store the updated values in the cache
        $cache = $this->getEndpointsCache();
        if ($cache === null) {
            return;
        }
        
        $update = [ $endpoints[$this->_currentEndpointIndex] ];
        for ($i = 0; $i < $numberOfEndpoints; ++$i) {
            if ($i !== $this->_currentEndpointIndex) {
                $update[] = $endpoints[$i];
            }
        }

        $ttl = (int) $this->_values[self::OPTION_MEMCACHED_TTL];
        $cache->set($this->_values[self::OPTION_MEMCACHED_ENDPOINTS_KEY], $update, $ttl);
      }