Skip to content

feat(http): add keepalive support for fetch requests in httpResource #61833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SkyZeroZx
Copy link
Contributor

@SkyZeroZx SkyZeroZx commented Jun 2, 2025

This commit adds support for the Fetch API's keepalive option when using httpResource with the withFetch provider.

The keepalive option is particularly useful for:

Beacon API-like functionality (logging analytics on page unload)
Better control over connection management in long-lived applications

Example new usage :

httpResource(() => ({
  url: '/api/log',
  method: 'POST',
  keepalive: true,
}));

This commit adds support for the Fetch API's keepalive option when using httpResource with the withFetch provider
@pullapprove pullapprove bot requested a review from AndrewKushnir June 2, 2025 19:11
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: common/http Issues related to HTTP and HTTP Client labels Jun 2, 2025
@ngbot ngbot bot added this to the Backlog milestone Jun 2, 2025
@AndrewKushnir AndrewKushnir requested review from alxhub and removed request for AndrewKushnir June 4, 2025 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: common/http Issues related to HTTP and HTTP Client detected: feature PR contains a feature commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants