function public function ProviderBase::getCacheTtl

8.x-3.x ProviderBase.php public ProviderBase::getCacheTtl($type)

Retrieves the cache time-to-live (TTL) value.

Parameters

string $type: The type of cache TTL value. Can be one of the following types:

If an invalid type was specified, the resulting TTL value will be 0.

Return value

int The cache TTL value, in seconds.

Overrides ProviderInterface::getCacheTtl

Class

ProviderBase
CDN Provider base class.

Namespace

Drupal\bootstrap\Plugin\Provider

Source src/Plugin/Provider/ProviderBase.php (line 263)

public function getCacheTtl($type) {
  if (!isset($this->cacheTtl[$type])) {
    $this->cacheTtl[$type] = (int) $this->theme->getSetting("cdn_cache_ttl_$type", static::TTL_NEVER);
    // If TTL is -1, the set a far reaching date from now.
    if ($this->cacheTtl[$type] === static::TTL_FOREVER) {
      $this->cacheTtl[$type] = static::TTL_ONE_YEAR * 10;
    }
  }
  return $this->cacheTtl[$type];
}