Skip to content

Conversation

@dreyks
Copy link

@dreyks dreyks commented Nov 9, 2018

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

I'm using terser caches to speed up CI builds. But it turned out that unlike say hard-source plugin terser plugin does not cleanup old obsolete caches. This leads to cache size snowballing and build performance degradation

So I've introduced a new option compactCache which is set to false by default. When enabled it will remove all cache entries that were not a part of the current build.
That way only one set of caches is retained. This means that if you change your code back and forth you'll get cache misses but since terser is mostly used in production builds only that should not be an issue - reverts to exact same old code are rare

Breaking Changes

Nope

Additional Info

@jsf-clabot
Copy link

jsf-clabot commented Nov 9, 2018

CLA assistant check
All committers have signed the CLA.

@alexander-akait
Copy link
Member

It is very degrade performance

@alexander-akait
Copy link
Member

Also it is very recommitted disable cache for CI and/or remove cache directory before/after build.

@alexander-akait
Copy link
Member

Anyway good work, i need consult with other developers about this, feel free to feedback

@dreyks
Copy link
Author

dreyks commented Nov 9, 2018

is it really a performance degradation? this is run only once at the end of the build. if used constantly there usually won't be many obsolete entries

@alexander-akait
Copy link
Member

@dreyks by default it is false - i.e. all ok 👍

@alexander-akait
Copy link
Member

@dreyks sorry for delay, not sure we should implement this option, why:

  • babel-loader have same option, but babel-loader you own implementation of cache, we use cacache, so you can use this interface to control of your cache
  • Exist rare edge cases where you can get invalid cache, so better avoid using development caches in CI (you can get green, but really it is red)

@anton164
Copy link

This would be useful. We are having issues with the terser cache building up over time so we need to manually clear it

@alexander-akait
Copy link
Member

alexander-akait commented May 14, 2020

@anton164 yep, please remove cache manually, if you have a problem with cache, please open a new issue with reproducible test repo

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.

4 participants