Angular 19 SSR/hybrid rendering engine: cross-request cache
- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 14 h 23 min
- PR fusionados (30 d)
- 162
Descripción
### 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_
Guía de contribución
Línea de trabajo
No se nombran archivos, pruebas ni puntos de entrada concretos. Empieza rastreando la ruta de solicitud de Angular SSR/hybrid rendering en el servidor Node y revisando cómo se usa global.fetch; define el alcance de la caché, su expiración y el comportamiento de Cache-Control antes de la implementación. Para darlo por terminado se necesitarían un diseño acordado, una implementación y cobertura para el almacenamiento en caché entre solicitudes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, node.js, typescript
- Área
- backend, performance, web-dev
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100