You are here

protected function AssetOptimizer::shouldGZip in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 src/Asset/AssetOptimizer.php \Drupal\advagg\Asset\AssetOptimizer::shouldGZip()

Determine if settings and available PHP modules allow GZipping assets.

Return value

bool True if asset type can/should be gzipped.

1 call to AssetOptimizer::shouldGZip()
AssetOptimizer::__construct in src/Asset/AssetOptimizer.php
Constructs the Optimizer object.

File

src/Asset/AssetOptimizer.php, line 293

Class

AssetOptimizer
Defines the base AdvAgg optimizer.

Namespace

Drupal\advagg\Asset

Code

protected function shouldGZip() {
  if (extension_loaded('zlib') && \Drupal::config('system.performance')
    ->get($this->extension . '.gzip')) {
    return TRUE;
  }
  return FALSE;
}