Q:

Ember publish unique asset filename for CDN freshness?

In order to force updated static assets to load from a stubborn CDN, I'm looking for a method of publsihing each of my src="assets/... references in app/index.html to unique filename, in order to keep CDN distributions fresh.
Maybe in index.html:
<link rel="stylesheet" href="assets/vendor.css?version={{content-for 'version'}}">

And then somewhere else I might override a custom content-for value with a random number or a build tag.
Ideas? Thanks!

A:

The answer is Ember fingerprinting.
It's enabled in production by default:
ember build --environment=production

This will result in (lines like) the following in index.html and corresponding asset file names:
<link rel="stylesheet" href="assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css" integrity="sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= sha512-z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==" >

To enable fingerprinting by default for all environments, add this to your ember-cli-build.js:
// ember-cli-build.js
var app = new EmberApp({
  fingerprint: {
    enabled: false
  }
});

