试图了解角度缓存破坏 [英] Trying to understand angular cache busting
问题描述
我正在运行angular6。使用--prod进行构建时,将使用诸如main.547a75c48dc342a8e291.js之类的名称来生成脚本。我以为每次都会生成一个唯一的名称,但似乎是相同的。
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.
角度CLI如何生成此名称?我是否应该提供另一种选择以确保我们每次进行生产构建时都是唯一的?
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?
推荐答案
547a75c48dc342a8e291
是一个哈希。如果对 main
没有任何更改,则哈希值将相同。通过更改 main
中包含的文件,哈希将有所不同,并且缓存将崩溃。
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.
这篇关于试图了解角度缓存破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!