ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
87 stars 84 forks source link

`ember s --prod` does not update hash between rebuilds. #115

Open ghost opened 7 years ago

ghost commented 7 years ago

The hash of files are not update between rebuilds when running the Ember CLI server in production mode.

Background: I'm caching the asset with a service worker. Ember CLI SRI does update the integrity hash between rebuilds, this causes the changed asset to not load.


To reproduce:

ember new test-app
cd test-app
ember s --prod

Now open localhost:4200 and note down the hash of test-app.js.

ember g component foo-bar

App reloads, note that the hash of test-app.js is still the same.

Now kill the test server and serve again with ember s --prod. Now the hash of test-app.js did change.

rwjblue commented 7 years ago

Definitely seems possibly, there is no testing (AFAIK) around recalculating / updating. Please dig in and let us know what you find...

Exelord commented 7 years ago

I have also this problem on heroku deploys. With every deploy, users have to refresh the page because the fingerprinting did not change.

mirague commented 6 years ago

We're running into issues with resource integrity as well. The current issue we're facing is the content of the css differs, but the md5 hash in the file is exactly the same:

image

This is a big issue since the initially generated file is cached long term on our CDN which means the old content is returned. This clashes with the expected integrity:

image

Edit: This happens for us on Heroku deploys (potentially the same as @Exelord), not on ember serve.

Edit 2: I've created issue #118 as this does not seem directly related to ember s --prod