Skip to content
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

Pre-RFC: Coalesced Responses #8856

Open
runspired opened this issue Sep 10, 2023 · 0 comments
Open

Pre-RFC: Coalesced Responses #8856

runspired opened this issue Sep 10, 2023 · 0 comments

Comments

@runspired
Copy link
Contributor

Similar to #8855 but for response handling

Processing results has non-trivial baseline overhead, especially for relationships. Often requests made close to each other contain result payloads that require work that could be deduplicated if processed together.

This proposal would add an optional coalescing feature to the CacheHandler. When coalescing, the handler would delay processing any payloads for a short time, and process any received payloads as a single batch, allowing XHR requests which resolve very close together to batch and dedupe similar work while still taking advantage of empty time while long requests are pending.

We may want to make the coalescing delay configurable, but the default would be to debounce await new Promise((resolve) => requestAnimationFrame(() => setTimeout(resolve, 0)));, thus waiting one frame past the last payload received to process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Planning
Development

No branches or pull requests

1 participant