Angular 19 SSR/hybrid rendering engine: cross-request cache
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 14h 23min
- PRs com merge (30d)
- 162
Descrição
### 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_
Guia de contribuição
Direção de pesquisa
Nenhum arquivo, teste ou ponto de entrada concreto é nomeado. Comece rastreando o caminho da requisição de Angular SSR/hybrid rendering no servidor Node e revisando como global.fetch é usado; defina o escopo do cache, a expiração e o comportamento de Cache-Control antes da implementação. Para considerar o trabalho concluído, seriam necessários um design acordado, uma implementação e cobertura para cache entre requisições.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- angular, node.js, typescript
- Domínio
- backend, performance, web-dev
- Tipo de issue
- Funcionalidade
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 25/100