Our application is self-hosted on nginx.
After releasing a new version of our app, (which is just removing all the old assets from the server, and replacing them with new ones that were the result of an ember build --environment=production
)
We are getting the following error message when reloading the application (in chrome):
Failed to find a valid digest in the 'integrity' attribute for resource '<hosted_endpoint>' with computed SHA-256 integrity '<integrity_hash>'. The resource has been blocked.
My guess it has something to do with the caching of static assets by ember-service-worker
and by extension ember-service-worker-asset-cache
, where the index.html
is already in the browser cache.
On a page refresh of our app, the integrity hash in the cached index.html no longer exists on the server, because of the new release, and the loading of the app crashes.
As far as I understand SRI is used to make sure the correct assets are loaded when serving assets from a CDN. In this case, I am not using a CDN.
As far as I understand, the service worker is correctly configured with a
versionStrategy: "every-build"
.
The only option I see right now is disabling ember-cli-sri
, but that seems like a bad idea. Disabling ember-service-worker
is no option.
I was hoping someone might have another idea.