only check useCache(varnish) for the flush command since it might be executed on a node that isn't behind varnish