The cache.maxGenerations config works in filesystem cache to keep .cache directory slim.
See original GitHub issueFeature request
What is the expected behavior?
The cache.maxGenerations
config works in filesystem
cache to keep cache files slim.
What is motivation or use case for adding/changing the behavior? Our project is huge, which generate a huge .cache directory over 800MB, and the cache size keep increasing with the passes of compilation. We run the CI progress in a new docker environment everytime when the project code changed, so we need store the .cache directory in outside storage, huge cache file will slow down the CI progress obviously.
I read the source code and find that filesystem cache always keep the unused items until the maxAge is exceeded, so what i need is to set maxGenerations limit to 1 and remove unused items from cache files everytime.
How should this be implemented in your opinion?
Record the generations in pack content items, read the cache.maxGenerations
config and decide to keep or remove unused items in Pack._optimizeUnusedContent
.
Are you willing to work on this yourself? Yes
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Ok, thanks for your answer, i will expect it.
The
maxGenerations
option is only to cache memory, we show it in our docsDefine the lifespan of unused cache entries in the memory cache.
https://webpack.js.org/configuration/cache/#cachemaxgenerations, but I see your problem, and we should solve, feel free to put feedback in https://github.com/webpack/webpack/issues/13291 so that we don’t lose it too