def store_asset(asset, unloaded)
        # Save the asset in the cache under the new URI
        cached_asset             = asset.dup
        cached_asset[:uri]       = compress_from_root(asset[:uri])
        cached_asset[:filename]  = compress_from_root(asset[:filename])
        cached_asset[:load_path] = compress_from_root(asset[:load_path])

        if cached_asset[:metadata]
          # Deep dup to avoid modifying `asset`
          cached_asset[:metadata] = cached_asset[:metadata].dup
          if cached_asset[:metadata][:included] && !cached_asset[:metadata][:included].empty?
            cached_asset[:metadata][:included] = cached_asset[:metadata][:included].dup
            cached_asset[:metadata][:included].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:links] && !cached_asset[:metadata][:links].empty?
            cached_asset[:metadata][:links] = cached_asset[:metadata][:links].dup
            cached_asset[:metadata][:links].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:stubbed] && !cached_asset[:metadata][:stubbed].empty?
            cached_asset[:metadata][:stubbed] = cached_asset[:metadata][:stubbed].dup
            cached_asset[:metadata][:stubbed].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:required] && !cached_asset[:metadata][:required].empty?
            cached_asset[:metadata][:required] = cached_asset[:metadata][:required].dup
            cached_asset[:metadata][:required].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:to_load] && !cached_asset[:metadata][:to_load].empty?
            cached_asset[:metadata][:to_load] = cached_asset[:metadata][:to_load].dup
            cached_asset[:metadata][:to_load].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:to_link] && !cached_asset[:metadata][:to_link].empty?
            cached_asset[:metadata][:to_link] = cached_asset[:metadata][:to_link].dup
            cached_asset[:metadata][:to_link].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:dependencies] && !cached_asset[:metadata][:dependencies].empty?
            cached_asset[:metadata][:dependencies] = cached_asset[:metadata][:dependencies].dup
            cached_asset[:metadata][:dependencies].map! do |uri|
              uri.start_with?("file-digest://".freeze) ? compress_from_root(uri) : uri
            end
          end

          # compress all _dependencies in metadata like `sass_dependencies`
          cached_asset[:metadata].each do |key, value|
            next unless key =~ /_dependencies\z/
            cached_asset[:metadata][key] = value.dup
            cached_asset[:metadata][key].map! {|uri| compress_from_root(uri) }
          end
        end

        # Unloaded asset and stored_asset now have a different URI
        stored_asset = UnloadedAsset.new(asset[:uri], self)
        cache.set(stored_asset.asset_key, cached_asset, true)

        # Save the new relative path for the digest key of the unloaded asset
        cache.set(unloaded.digest_key(asset[:dependencies_digest]), stored_asset.compressed_path, true)
      end
def store_asset(asset, unloaded)
        # Save the asset in the cache under the new URI
        cached_asset             = asset.dup
        cached_asset[:uri]       = compress_from_root(asset[:uri])
        cached_asset[:filename]  = compress_from_root(asset[:filename])
        cached_asset[:load_path] = compress_from_root(asset[:load_path])

        if cached_asset[:metadata]
          # Deep dup to avoid modifying `asset`
          cached_asset[:metadata] = cached_asset[:metadata].dup
          if cached_asset[:metadata][:included] && !cached_asset[:metadata][:included].empty?
            cached_asset[:metadata][:included] = cached_asset[:metadata][:included].dup
            cached_asset[:metadata][:included].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:links] && !cached_asset[:metadata][:links].empty?
            cached_asset[:metadata][:links] = cached_asset[:metadata][:links].dup
            cached_asset[:metadata][:links].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:stubbed] && !cached_asset[:metadata][:stubbed].empty?
            cached_asset[:metadata][:stubbed] = cached_asset[:metadata][:stubbed].dup
            cached_asset[:metadata][:stubbed].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:required] && !cached_asset[:metadata][:required].empty?
            cached_asset[:metadata][:required] = cached_asset[:metadata][:required].dup
            cached_asset[:metadata][:required].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:to_load] && !cached_asset[:metadata][:to_load].empty?
            cached_asset[:metadata][:to_load] = cached_asset[:metadata][:to_load].dup
            cached_asset[:metadata][:to_load].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:to_link] && !cached_asset[:metadata][:to_link].empty?
            cached_asset[:metadata][:to_link] = cached_asset[:metadata][:to_link].dup
            cached_asset[:metadata][:to_link].map! { |uri| compress_from_root(uri) }
          end

          if cached_asset[:metadata][:dependencies] && !cached_asset[:metadata][:dependencies].empty?
            cached_asset[:metadata][:dependencies] = cached_asset[:metadata][:dependencies].dup
            cached_asset[:metadata][:dependencies].map! do |uri|
              uri.start_with?("file-digest://".freeze) ? compress_from_root(uri) : uri
            end
          end

          # compress all _dependencies in metadata like `sass_dependencies`
          cached_asset[:metadata].each do |key, value|
            next unless key =~ /_dependencies\z/
            cached_asset[:metadata][key] = value.dup
            cached_asset[:metadata][key].map! {|uri| compress_from_root(uri) }
          end
        end

        # Unloaded asset and stored_asset now have a different URI
        stored_asset = UnloadedAsset.new(asset[:uri], self)
        cache.set(stored_asset.asset_key, cached_asset, true)

        # Save the new relative path for the digest key of the unloaded asset
        cache.set(unloaded.digest_key(asset[:dependencies_digest]), stored_asset.compressed_path, true)
      end
Internal: Save a given asset to the cache

 asset - A hash containing values of loaded asset
 unloaded - The UnloadedAsset used to lookup the `asset`

 This method converts all absolute paths to "compressed" paths
 which are relative if they're in the root.