angular / angular/angular-cli

Angular 19 SSR/hybrid rendering engine: cross-request cache

オープン
#30,305 コメント 4 件 リアクション 29 件 担当者 0 名 GitHub で見る
area: @angular/ssr feature feature: under consideration
主要言語
TypeScript
スター
27k
フォーク
11.8k
平均マージ
14時間 23分
マージ済み PR(30日)
162

説明

### Command

run

### Description

It would be a useful optimization to cache some requests during SSR across requests to the SSR server. Some of the API requests have infrequently changing data. Pulling the response from cache would save a lot of network time, especially if the response is big.

Flow:
User 1 makes makes request to Angular SSR server -> SSR makes requests to API in order to gather data for rendering -> request gets cached -> user 1 receives an html response.
User 2 makes request to Angular SSR server -> SSR server would make API request in order to gather data, but instead pulls the response from the cache -> user 2 receives an html response.

One possible implementation would be to consider Cache-Control header and cache the response in the server for the time specified.

If this will not be considered - what would you say is the best approach in order to optimize these kind of API requests? Perhaps a wrapper around `global.fetch` in Node server (where Angular engine runs) which would monitor every API request and store in some local cache?

### Describe the solution you'd like

_No response_

### Describe alternatives you've considered

_No response_

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

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

調査の方向性

ファイル、テスト、具体的なエントリポイントは指定されていません。まず、Node サーバー内の Angular SSR/hybrid rendering のリクエストパスを追跡し、global.fetch がどのように使われているかを確認してください。実装前に、キャッシュのスコープ、有効期限、Cache-Control の動作を定義します。完了とするには、合意された設計、実装、およびリクエスト間キャッシュに対するカバレッジが必要です。

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

評価

技術スタック
angular, node.js, typescript
領域
backend, performance, web-dev
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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