Same name in other branches
  1. 6.0.x src/Asset/JsOptimizer.php \Drupal\advagg\Asset\JsOptimizer::addDnsPrefetch()
  2. 8.x-3.x src/Asset/JsOptimizer.php \Drupal\advagg\Asset\JsOptimizer::addDnsPrefetch()
  3. 8.x-4.x src/Asset/JsOptimizer.php \Drupal\advagg\Asset\JsOptimizer::addDnsPrefetch()

Overrides AssetOptimizer::addDnsPrefetch

Fichier

src/Asset/JsOptimizer.php, line 25

Classe

JsOptimizer
The JavaScript Optimizer.

Namespace

Drupal\advagg\Asset

Code

protected function addDnsPrefetch(array $asset) {
    // Check if Google Ad Manager and add DNS prefetch.
    $prefetch = $this->testForGoogleAdManager($asset['data']);
    // Check if Google Analytics and add DNS prefetch.
    $prefetch += $this->testForGoogleAnalytics($asset['data']);
    return $prefetch;
}