Output-hashing in Angular prevents version inconsistencies between parts of the application when browser or proxy cache is active.
With PWA, same is achieved with Service-Worker and ngsw.json
which is also based on hashes.
Are there any scenarios where outputHashing=all
can still be useful with PWA enabled? Are there any downsides of keeping it turned on?
IE is out of scope.
If you consider deploying your static files to a file storage somewhere and you have output hashing enabled, your files will be named something like
main.23kj4h32kj4h3423.js
instead of justmain.js
. After deploying a new version to that storage, you'll have some cleaning up to do because main.xxx.js just got a new file name.On the other hand, if you have a really large app and uploading all files to that same storage takes a while, you need to consider the scenario where a user visits your site somewhere in the middle of the upload process. Let's say you don't have output hashing enabled, the visitor might get some old and some new files.