Automattic\WooCommerce\Internal\Api

QueryCache::is_caching_enabledprivateWC 1.0

Whether at least one cache backend is enabled (and, for OPcache, usable).

Used to short-circuit the standard-query path when neither backend is available, so the request is parsed once with no cache lookup overhead.

Метод класса: QueryCache{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->is_caching_enabled(): bool;

Код QueryCache::is_caching_enabled() WC 11.0.1

private function is_caching_enabled(): bool {
	return ( Main::is_opcache_enabled() && $this->is_opcache_usable() )
		|| Main::is_object_cache_enabled();
}