okonet / Webpack Long Term Cache Demo
Licence: mit
A demo config showing how to enable long-term caching using Webpack. Read [medium link] for details.
Stars: ✭ 105
Programming Languages
javascript
184084 projects - #8 most used programming language
webpack-long-term-cache-demo
A demo webpack config showing how to enable long-term caching using Webpack. Read Long-term caching of static assets with Webpack for details.
To enable long-term caching of static resources produced by webpack:
- Use
[chunkhash]
to add a content-dependent cache-buster to each file. - Use compiler stats to get the file names when requiring resources in HTML.
- Generate the chunk-manifest JSON and inline it into the HTML page before loading resources.
- Ensure that the entry point chunk containing the bootstrapping code doesn’t change its hash over time for the same set of dependencies.
- Profit!
How to run
npm install
npm start
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].