Automattic\WooCommerce\Internal\Api

QueryCache::get_cache_ttlpublic staticWC 1.0

The time-to-live (in seconds) for a cached parsed query.

Reads the {@see Main::OPTION_QUERY_CACHE_TTL} store option; falls back to {@see self::DEFAULT_CACHE_TTL} when the option is unset, empty, or non-positive.

Method of the class: QueryCache{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = QueryCache::get_cache_ttl(): int;

QueryCache::get_cache_ttl() code WC 10.9.1

public static function get_cache_ttl(): int {
	$value = (int) get_option( Main::OPTION_QUERY_CACHE_TTL, self::DEFAULT_CACHE_TTL );
	return $value > 0 ? $value : self::DEFAULT_CACHE_TTL;
}