Add configurable size limit for persistent build cache with LRU eviction
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 45/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- angular, typescript
- Domaine
- build-system, cli
Piste de recherche
Commencez par le cache persistant utilisé par les commandes build et serve, puis comparez-le au point d’entrée existant ng cache clean pour .angular/cache. Définissez comment cli.cache.maxSize est configuré et mesuré, puis vérifiez que les entrées les moins récemment utilisées sont supprimées une fois la limite configurée dépassée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Command
build, serve
Description
The Angular CLI persistent disk cache (.angular/cache) grows without bounds. On large projects, a single checkout accumulates tens of gigabytes of cached build artifacts. In our case, a single checkout reached 29 GB.
This was previously raised in #25116 and closed as not feasible with Webpack. Since Angular 17+, the build system uses esbuild, so the original constraint no longer applies.
Describe the solution you'd like
Add a configurable size cap (e.g., cli.cache.maxSize) with LRU eviction when the limit is reached. This is a common pattern in build tooling — Turborepo, Gradle, and most browsers' HTTP caches all implement bounded persistent caches.
Example configuration:
"cli": {
"cache": {
"enabled": true,
"maxSize": "2GB"
}
}
When the cache exceeds maxSize, the oldest/least-recently-used entries are evicted.
Describe alternatives you've considered
- Periodically running
ng cache cleanor manually deleting.angular/cache— works but is a manual maintenance burden, especially for developers unaware the cache is growing.
- Langage dominant
- TypeScript
- Étoiles
- 27k
- Forks
- 11.8k
- Merge moyen
- 16 h 21 min
- PR mergées (30 j)
- 170
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de angular/angular-cli
-
area: @angular/build gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
angular/angular-cli#34129 ·
-
Support aube as package manager Ouvertearea: @angular/cli gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
angular/angular-cli#34057 ·
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Ouvertearea: @angular/build gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
angular/angular-cli#33055 · 1 commentaire · 3 réactions ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 personne assignée ·