Skip to content

Note concerning ngx.location.capture buffering all subrequest c… #607

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

Closed
wants to merge 1 commit into from

Conversation

cmaion
Copy link

@cmaion cmaion commented Nov 23, 2015

@@ -3120,6 +3120,7 @@ Nginx's subrequests provide a powerful way to make non-blocking internal request
`ngx_postgres`, `ngx_drizzle`, and even ngx_lua itself and etc etc etc.

Also note that subrequests just mimic the HTTP interface but there is *no* extra HTTP/TCP traffic *nor* IPC involved. Everything works internally, efficiently, on the C level.
This also mean that subrequests are fully performed and buffered before being returned to Lua: making a subrequest call to a location that can return or stream a large amount of data (including by using sendfile) is probably a bad idea.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm afraid there is no causal relationship here. The real reason behind the always-fully-buffering behaviour is that this API just does not support streaming.

agentzh added a commit that referenced this pull request Dec 11, 2015
….capture* API. thanks cmaion for the original patch in #607.
@agentzh
Copy link
Member

agentzh commented Dec 11, 2015

@cmaion Just committed a different patch to git master to address this concern. Thanks for the patch all the same.

@agentzh agentzh closed this Dec 11, 2015
@cmaion
Copy link
Author

cmaion commented Dec 14, 2015

Thanks @agentzh!
At first I wasn't sure about how to rewrite this in a way that is both correct and would suit you :) and then I simply forgot about it.
Thanks again!

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

Successfully merging this pull request may close these issues.

2 participants