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

Overrides AssetOptimizer::addDnsPrefetch

File

src/Asset/JsOptimizer.php, line 25

Class

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;
}