Skip to content

Long-term caching with Webpack 2 #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jouni-kantola
Copy link
Contributor

@jouni-kantola jouni-kantola commented Jan 17, 2017

Updated description for long-term caching with Webpack 2

  • Describes scenario for long-term caching, where manifest is separated into entry where chunk manifest is extracted into own file
  • Does not describe the option of using recordsPath
  • Does not describe into detail what causes hash changes

Addresses issues: #652 and webpack/webpack#1315


T> Separate your vendor and application code with [CommonsChunkPlugin](/plugins/commons-chunk-plugin) and create an explicit vendor chunk to prevent it from changing too often.
Webpack allows you to generate hashes depending on file contents, by replacing the placeholder `[hash]` with `[chunkhash]`. Here is the updated config:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/s/Webpack/webpack (it's in dev docs, this needs a linting rule).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated Webpack to webpack. I also proof-read and updated the docs once more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I agree about the linting rule. webpack as first word in sentences will probably often be written with a capital 'W'.

@jouni-kantola jouni-kantola force-pushed the feature/deterministic-chunk-hashes branch from 8e96846 to d1c1dad Compare January 18, 2017 17:17
@jouni-kantola
Copy link
Contributor Author

@bebraw: What do you think about the title, Caching as-is or Long-term caching?

@redonkulus
Copy link

@jouni-kantola thanks for doing this. It seems this PR would fix #677 that I opened as well.

@bebraw bebraw merged commit 0a347b3 into webpack:master Jan 19, 2017
@bebraw
Copy link
Contributor

bebraw commented Jan 19, 2017

Thanks for the work. Further improvements can be handled through separate PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants