public function banByTags(array $tags, $domains = null)
    {
        if (count($this->settings['ignoredCacheTags']) > 0) {
            $tags = array_diff($tags, $this->settings['ignoredCacheTags']);
        }

        /**
         * Sanitize tags
         * @see \Neos\Fusion\Core\Cache\ContentCache
         */
        foreach ($tags as $key => $tag) {
            $tags[$key] = strtr($tag, '.:', '_-');
        }

        // Set specific domain before invalidating tags
        if ($domains) {
            $this->varnishProxyClient->setDefaultBanHeader(ProxyClient\Varnish::HTTP_HEADER_HOST, is_array($domains) ? '^(' . implode('|', $domains) . ')$' : $domains);
        }
        $this->tagHandler->invalidateTags($tags);
        // Unset specific domain after invalidating tags
        if ($domains) {
            $this->varnishProxyClient->setDefaultBanHeader(ProxyClient\Varnish::HTTP_HEADER_HOST, ProxyClient\Varnish::REGEX_MATCH_ALL);
        }
        $this->logger->log(sprintf('Cleared Varnish cache for tags "%s"%s', implode(',', $tags), $domains ? ' for domains "' . (is_array($domains) ? implode(', ', $domains) : $domains) . '"' : ''));
        $this->execute();
    }
public function banByTags(array $tags, $domains = null)
    {
        if (count($this->settings['ignoredCacheTags']) > 0) {
            $tags = array_diff($tags, $this->settings['ignoredCacheTags']);
        }

        /**
         * Sanitize tags
         * @see \Neos\Fusion\Core\Cache\ContentCache
         */
        foreach ($tags as $key => $tag) {
            $tags[$key] = strtr($tag, '.:', '_-');
        }

        // Set specific domain before invalidating tags
        if ($domains) {
            $this->varnishProxyClient->setDefaultBanHeader(ProxyClient\Varnish::HTTP_HEADER_HOST, is_array($domains) ? '^(' . implode('|', $domains) . ')$' : $domains);
        }
        $this->tagHandler->invalidateTags($tags);
        // Unset specific domain after invalidating tags
        if ($domains) {
            $this->varnishProxyClient->setDefaultBanHeader(ProxyClient\Varnish::HTTP_HEADER_HOST, ProxyClient\Varnish::REGEX_MATCH_ALL);
        }
        $this->logger->log(sprintf('Cleared Varnish cache for tags "%s"%s', implode(',', $tags), $domains ? ' for domains "' . (is_array($domains) ? implode(', ', $domains) : $domains) . '"' : ''));
        $this->execute();
    }
public function banByTags ( array $ tags , $ domains = null ) { if ( count ( $ this -> settings [ 'ignoredCacheTags' ] ) > 0 ) { $ tags = array_diff ( $ tags , $ this -> settings [ 'ignoredCacheTags' ] ) ; } /**
         * Sanitize tags
         * @see \Neos\Fusion\Core\Cache\ContentCache
         */ foreach ( $ tags as $ key => $ tag ) { $ tags [ $ key ] = strtr ( $ tag , '.:' , '_-' ) ; } // Set specific domain before invalidating tags if ( $ domains ) { $ this -> varnishProxyClient -> setDefaultBanHeader ( ProxyClient \ Varnish :: HTTP_HEADER_HOST , is_array ( $ domains ) ? '^(' . implode ( '|' , $ domains ) . ')$' : $ domains ) ; } $ this -> tagHandler -> invalidateTags ( $ tags ) ; // Unset specific domain after invalidating tags if ( $ domains ) { $ this -> varnishProxyClient -> setDefaultBanHeader ( ProxyClient \ Varnish :: HTTP_HEADER_HOST , ProxyClient \ Varnish :: REGEX_MATCH_ALL ) ; } $ this -> logger -> log ( sprintf ( 'Cleared Varnish cache for tags "%s"%s' , implode ( ',' , $ tags ) , $ domains ? ' for domains "' . ( is_array ( $ domains ) ? implode ( ', ' , $ domains ) : $ domains ) . '"' : '' ) ) ; $ this -> execute ( ) ; }
Clear all cache in Varnish for given tags.

The hosts parameter can either be a regular expression, e.g.
'^(www\.)?(this|that)\.com$' or an array of exact host names, e.g.
['example.com', 'other.net']. If the parameter is empty, all hosts
are matched.

@param array $tags
@param array|string $domains The domain to flush, e.g. "example.com"
@return void
Clear all cache in Varnish for given tags .