Cache busting
To use caching with the static resources produced by Webpack, it's a good practice to append the filenames of the static resources with hashes. [chunkhash] will generate a content-dependent hash, which should be appended to the filename that acts as the cache buster. Whenever the content of the file changes, the hash will change, which will lead to new filenames and, hence, regenerating the cache.
Only production builds need cache busting logic. Development builds do not need these configurations. Hence, we need to generate hashed filenames only at production. Also, we must generate a manifest.json file that contains the new filenames of the generated resources that must be inlined into the HTML file. Configurations for cache ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access