Search code examples
angularbuildbrowser-cache

Trying to understand angular cache busting


I am running angular 6. When building with --prod, the scripts are generated with a name such as main.547a75c48dc342a8e291.js. I assumed that was a unique name generated each time but it seems to be the same.

How does angular CLI generate this name? Should I be giving another option to ensure that every time we do a production build it is unique?


Solution

  • 547a75c48dc342a8e291 is a hash. If there are no changes to main the hash would be the same. By changing a file included in main, the hash will be different, and the cache will bust.