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?
Cache busting example This means that once cached locally on the user's browser, the browser won't check the origin server again for 1 whole year to see if any updates have been made to the file.
Cache busting is a way to prevent browsers from caching your ad content. Cache busting adds a random string to your ad tag each time the tag fires — typically a random number. Because the tag has a different number each time, the browser sends a new request each time.
Angular cache There is no command to clear the cache, just run rm -rf . angular/cache .
Using shareReplay shareReplay helps us cache data in our apps quickly and replay the data to new subscribers. Add the shareReplay operator in the flow of data, take the data from the HTTP request, and put it into a buffer so that it can replay the last emission of my HTTP request.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With