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

Chunking of subrequests #49

Open
kkmuffme opened this issue Jun 4, 2016 · 4 comments
Open

Chunking of subrequests #49

kkmuffme opened this issue Jun 4, 2016 · 4 comments

Comments

@kkmuffme
Copy link

kkmuffme commented Jun 4, 2016

Hey

For echo_flush it states:

This directive will fail to flush the output buffer in case of subrequests get involved

Does chunking subrequests work however with this module (on nginx 1.5+; chunking is part of nginx core since 1.3.9)? (no need for echo_flush then)

@agentzh
Copy link
Member

agentzh commented Jun 4, 2016

In nginx, "flushing" has nothing to do with "chunking". So I'm confused here. Also, you seem to be confused chunked response bodies with chunked request bodies. Anyway, I don't quite follow you.

@kkmuffme
Copy link
Author

kkmuffme commented Jun 5, 2016

You are right, sorry this was a bit disambigous (and I had a little confusion).
What I really mean:
If the subrequest (called via echo_location_async) includes the echo_flush, will it flush it, or still wait for the other subrequests?
If I call php in a subrequest block (called via echo_location_async) and use the flush() (and ob_flush) in the php file, will it flush it or not? (so does it keep the "normal" behavior of php or not)

@agentzh
Copy link
Member

agentzh commented Jun 6, 2016

@DuckDagobert If there is no pending subrequests to complete before the current subrequest, then my hunch is that echo_flush should do what it is supposed to do. But you'll have to do your own testing to be sure. The PHP thing can be more complicated, depending on how you configure your ngx_fastcgi module's buffering and your PHP implementation's buffering. Oh well.

@kkmuffme
Copy link
Author

kkmuffme commented Jun 9, 2016

After some testing and some more research, I decided to do it all with lua nginx module (as I have more control, need fewer subrequests, can have non blocking subrequests and can echo all subrequests separately, optimised code,... using a couple openresty module; basically emulating facebook's bigpipe/how I think taobao does their pagelets)

You really are a genius! openresty is amazing :-)

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

2 participants