-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Angular cache dir (.angular) grows and grows #22323
Comments
Hi @jcompagner, There are several parts of the pipeline that are cached on disk, the main benefit of this is that future compilations become warm as the build state is restored from disk instead of having to start the build from a cold state. This helps to decrease the build time by up to 65% as a number of computations are not performed. There are a number of things that are cached, including but not limited to:
The cache is expected to continue to grow, unless it is periodically purged by the users. The more code changes are performed in a repo, the larger the cache will become. You can read the cache documentation on how to the clear the cache. In future, we are hoping to perform automatic cleanups of stalled cache data. It would be interesting to know which files/directories are consuming the most disk usage. Can you please provide some metrics? |
currently after a clean with a first build: .angular\cache\angular-webpack\452f48df2f16eff7f35d217be73a1e17c8ec5851 the 0.pack file is taking almost all the space 447MB (the whole cache dir id 472MB) after i have installed 2 updates of packages and run a build the total size si already grown to 516MB -a--- 9-12-2021 17:22 217749179 0.pack then i run one build again: -a--- 9-12-2021 17:22 217749179 0.pack running one other build again: -a--- 9-12-2021 17:22 217749179 0.pack (these builds are not production builds but kind of debug builds without watch) so every build it generates a bit more and maybe it adjust the last file it added... |
Webpack have actually a PR in flight to delete old pack files webpack/webpack#14661. |
by the way would it be possible to not include the fully path in those pack files? D:\servoy_inst\202112\developer\ws.metadata.plugins\com.servoy.eclipse.ngclient.ui\target\ if i count that now over the latest pack files described above its about 140K hits... |
The pack file are generated by Webpack and we don't have control over their contents. |
today i got a new uuid folder:
and before of that it almost doubled it again (now its around 1GB in total) What i don't fully understand is that a build makes it constantly grow And i guess if a new package install is done (or what ever makes kind of the cache invalid) it would be nice to then first auto clean the cache.. |
The new UUID is expected. The cache key changed because of a new release, which results in the old cache to stale. I think in this case we should do an automatic clean for known stale directories. This is something that we can potentially do. Regarding the additional pack file when no files have been changed. This shouldn't happen, I was able to replicate it but so far I haven't narrowed down whats the problem and if a bug in the Angular CLI or Webpack. |
I have debugging this a bit and there are 2 root causes of extra pack files when files have not changed.
|
…ache entries With every build-angular release, previously created cache entries get stale and are no longer used. This causes the cache to keep growing as older files are not purged. With this change we automatically purge entries that have been created with older version of build-angular and can no longer be used with the current installed version. Closes #22323 (cherry picked from commit 6d2087b)
…ache entries With every build-angular release, previously created cache entries get stale and are no longer used. This causes the cache to keep growing as older files are not purged. With this change we automatically purge entries that have been created with older version of build-angular and can no longer be used with the current installed version. Closes #22323
nice that it is fixed. i will try a new release asap to see how it behaves now |
@jcompagner, this should be included in |
ok this is way better.. i didn't delete my 15GB cache dir, just let the latest release run on top of that, and yes it fully cleared it. then i did run a production build and the cache did grow to 490MB (i did see an extra dir in angular-webpack) (and also no subresourceIntegrity warnings anymore ;) ) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When building our product with Angular 13 the .angular/cache is now generated.
At a first build thats around 500MB but it will not take long and it is grown to 9GB is that normal?
What is exactly cached there and how is it reused?
The text was updated successfully, but these errors were encountered: