question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The cache.maxGenerations config works in filesystem cache to keep .cache directory slim.

See original GitHub issue

Feature 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:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hiyukicommented, Dec 21, 2021

Ok, thanks for your answer, i will expect it.

1reaction
alexander-akaitcommented, Dec 21, 2021

The maxGenerations option is only to cache memory, we show it in our docs Define 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cache - webpack
Defaults to node_modules/.cache/webpack . cache.cacheDirectory option is only available when cache.type is set to 'filesystem' . webpack.config.js
Read more >
Can I purge old and outdated cache files? #13291 - GitHub
After about 6 months, we find there is a 800MB cache directory with more ... maxGenerations config works in filesystem cache to keep...
Read more >
Chapter 9. Getting started with FS-Cache
9.4. Cache cull limits configuration. The cachefilesd daemon works by caching remote data from shared file systems to free space on the disk....
Read more >
cache dir | Data Version Control - DVC
cache dir. Set/unset the cachecache directory location intuitively (compared to using dvc config cache ), or shows the current configured value.
Read more >
Cache on Already Mounted Filesystem
CacheFiles is a caching backend that's meant to use as a cache a directory on an already mounted filesystem of a local type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found