tooling.report

feature

Asset-of-asset hash cascading

When an asset depends on an asset, and the asset is changed, are the hashes correctly updated?

Person in labcoat walking left

Why

Some asset types can have their own dependencies, much like JavaScript modules can. It's common to treat CSS and SVGs as assets, but both formats can include references to images, fonts or stylesheets. When processing assets to add hashes to filenames, it's important that changing the URL hash of a subresource also changes the hashes of any assets referencing it.

body {
  /* an image "dependency": */
  background-image: url(background.jpg);
}

When bundling the above CSS and its referenced image with hashed URLs, any changes to background.jpg will also change its hash (background.a1b2c.jpg). Since the CSS must be updated to reference the image's new URL hash, the CSS file must also be given a new hashed URL now that its contents have changed.

Use the (+) card below & tell us if we missed a capability!

Plant with tall leafs and vines in a pot

Questions or Concerns?

We want to hear from you, let us know how to make this better. Open up a GitHub issue and we’ll track it there. Thanks!

Open a GitHub Issue