feat: support invalidate persistent cache using config.mode and config.name - #8920
Conversation
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
CodSpeed Performance ReportMerging #8920 will not alter performanceComparing Summary
|
|
Hey 👋 Just wondering, do you also plan to support On Docusaurus we have to manage multiple caches with const name = isServer ? 'server' : 'client';
const mode = isProd ? 'production' : 'development';
cache.name: `${name}-${mode}-${props.i18n.currentLocale}`More details here: |
|
@slorber We currently have no plans to support cache.version: props.i18n.currentLocale + ... |
|
@jerrykingxyz We can add some guides for migrating from the webpack cache configuration to Rspack experiments cache. |
I tried that and it works, but I noticed a difference, explained in facebook/docusaurus#10931 (comment) In Webpack, when the version changes, the cache dir remains clean over time: In Rspack, when the version changes, the cache dir continues to grow, with new subfolders being added, and the former ones not being removed: It's not a big deal to me, but I thought I should report this issue and it could be better to avoid a |
@slorber Yes, Rspack will try to clean up cache dir that have not been used for a long time(7 days) every time the program is started. https://rspack.dev/config/experiments#cachestorage The current directory structure is not necessarily a perfect solution, but we hope to expose as few configuration items as possible so that the subsequent remote cache can have more flexibility. |


Summary
Support invalidate persistent cache using config.mode and config.name.
Checklist