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

@defer: don't block in CachingHttpInterceptor #3981

Closed
BoD opened this issue Mar 31, 2022 · 1 comment
Closed

@defer: don't block in CachingHttpInterceptor #3981

BoD opened this issue Mar 31, 2022 · 1 comment
Assignees

Comments

@BoD
Copy link
Contributor

BoD commented Mar 31, 2022

When using @defer the expectation is that the deferred parts are surfaced as soon as they arrive.

However, the current implementation of CachingHttpInterceptor is reading the whole HttpResponse in order to cache it, before returning it. In effect this waits for all the chunks to be received, and so they're not emitted as they go.

A possible solution would be to have a body 'delegate' which writes to the cache as it is read. An example of this existed in v2 here.

Note: this is also true of LoggingInterceptor albeit since this is used as a debugging tool, this can be considered OK (adding a warning on the doc would be nice).

@BoD
Copy link
Contributor Author

BoD commented May 12, 2022

Done in #4076

@BoD BoD closed this as completed May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant