private static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '')
    {
        if ($additionalFilter) {
            $asset = clone $asset;
            $asset->ensureFilter($additionalFilter);
        }

        $cacheKey  = $asset->getSourceRoot();
        $cacheKey .= $asset->getSourcePath();
        $cacheKey .= $asset->getTargetPath();
        $cacheKey .= $asset->getLastModified();

        foreach ($asset->getFilters() as $filter) {
            if ($filter instanceof HashableInterface) {
                $cacheKey .= $filter->hash();
            } else {
                $cacheKey .= serialize($filter);
            }
        }

        if ($values = $asset->getValues()) {
            asort($values);
            $cacheKey .= serialize($values);
        }

        return md5($cacheKey.$salt);
    }
private static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '')
    {
        if ($additionalFilter) {
            $asset = clone $asset;
            $asset->ensureFilter($additionalFilter);
        }

        $cacheKey  = $asset->getSourceRoot();
        $cacheKey .= $asset->getSourcePath();
        $cacheKey .= $asset->getTargetPath();
        $cacheKey .= $asset->getLastModified();

        foreach ($asset->getFilters() as $filter) {
            if ($filter instanceof HashableInterface) {
                $cacheKey .= $filter->hash();
            } else {
                $cacheKey .= serialize($filter);
            }
        }

        if ($values = $asset->getValues()) {
            asort($values);
            $cacheKey .= serialize($values);
        }

        return md5($cacheKey.$salt);
    }
private static function getCacheKey ( AssetInterface $ asset , FilterInterface $ additionalFilter = null , $ salt = '' ) { if ( $ additionalFilter ) { $ asset = clone $ asset ; $ asset -> ensureFilter ( $ additionalFilter ) ; } $ cacheKey = $ asset -> getSourceRoot ( ) ; $ cacheKey .= $ asset -> getSourcePath ( ) ; $ cacheKey .= $ asset -> getTargetPath ( ) ; $ cacheKey .= $ asset -> getLastModified ( ) ; foreach ( $ asset -> getFilters ( ) as $ filter ) { if ( $ filter instanceof HashableInterface ) { $ cacheKey .= $ filter -> hash ( ) ; } else { $ cacheKey .= serialize ( $ filter ) ; } } if ( $ values = $ asset -> getValues ( ) ) { asort ( $ values ) ; $ cacheKey .= serialize ( $ values ) ; } return md5 ( $ cacheKey . $ salt ) ; }
Returns a cache key for the current asset.

The key is composed of everything but an asset's content:

* source root
* source path
* target url
* last modified
* filters

@param AssetInterface  $asset            The asset
@param FilterInterface $additionalFilter Any additional filter being applied
@param string          $salt             Salt for the key

@return string A key for identifying the current asset
Returns a cache key for the current asset .