I think it should be possible to change the [hash:8] in file-loader to use [contenthash:8] which should mean that if you don't make changes to a file it wouldn't get a new hash when you rebuild.
https://github.com/jaredpalmer/razzle/blob/master/packages/razzle/config/createConfig.js#L159
Using [hash:8] would mean a per-build hash is used on the file so every build/deploy would invalidate the cache those media resources.
Using [contenthash:8] should make it a stable filename across builds as long as the content of the file doesn't change, meaning you can have longer lived caching on static files.
My initial thought was that this could also be applied to url-loader as well https://github.com/jaredpalmer/razzle/blob/master/packages/razzle/config/createConfig.js#L171
But I'm a bit confused at the config here because it seems like it's passing options to url-loader that it doesn't support. emitFile and name don't seem to be valid options https://webpack.js.org/loaders/url-loader/
Should url-loader be specifying a fallback to file-loader instead? I'm not exactly sure without spending more time investigating
I鈥檓 not quite sure about this either. Did url loader change maybe? I need to investigate too. 馃
fixed in dev
Most helpful comment
fixed in dev