1

I am facing caching issue with my Angular app. I have used several approach but issue is still there. For creating the build, I am using following command.

ng build --prod --output-hashing=all --aot

Can we add version number after hash file name like as below.

<script src='runtime.834594739.js?v=12345678'></script>

Please suggest, how to add version number with build file which auto adds in index.html file on runtime.

Thanks

Mukesh Kumar
  • 2,354
  • 4
  • 26
  • 37

1 Answers1

0

The correct param is --outputHashing, not --output-hashing. Just focus on -- (double hyphen)

Documentation.

Angular manages that on its own, just use it correctly.

Mukesh Kumar
  • 2,354
  • 4
  • 26
  • 37
  • Both will work. But after using this, my file is still being cached. After deploying the new version, we are able to see old file data. – Mukesh Kumar Sep 25 '19 at 08:53
  • Please share the output of your `build` command. If the cache busting is enabled, there is absolutely no reason for it to not work. –  Sep 25 '19 at 09:01