Add configurable size limit for persistent build cache with LRU eviction

オープン
#33,320 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
angular, typescript
領域
build-system, cli

調査の方向性

build コマンドと serve コマンドで使用される永続キャッシュから始め、.angular/cache 用の既存のエントリポイント ng cache clean と比較します。cli.cache.maxSize の設定方法と測定方法を定義し、設定された上限を超えた時点で最も最近使用されていないエントリが削除されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

area: @angular/cli gemini-triaged needs: more info
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 clean or manually deleting .angular/cache — works but is a manual maintenance burden, especially for developers unaware the cache is growing.
主要言語
TypeScript
スター
27k
フォーク
11.8k
平均マージ
16時間 21分
マージ済み PR(30日)
170

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

angular/angular-cli のほかの issue

angular/angular-cli の issue をすべて見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。