public function AssetCache::load

Loads the asset into memory and applies load filters.

You may provide an additional filter to apply during load.

Parameters

FilterInterface $additionalFilter An additional filter:

Overrides AssetInterface::load

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php, line 49

Class

AssetCache
Caches an asset to avoid the cost of loading and dumping.

Namespace

Assetic\Asset

Code

public function load(FilterInterface $additionalFilter = null) {
  $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'load');
  if ($this->cache
    ->has($cacheKey)) {
    $this->asset
      ->setContent($this->cache
      ->get($cacheKey));
    return;
  }
  $this->asset
    ->load($additionalFilter);
  $this->cache
    ->set($cacheKey, $this->asset
    ->getContent());
}