Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I was happy to learn briefly about BigPipe & D8. Would be great to have some documentation to help explain more about how to get started. I did test that it installs nicely with SimplyTest.me, but it would be good to be able to know what else you'd need to do. Seems like there's no configuration at the moment.
Comments
Comment #2
Wim LeersIndeed, there's no documentation.
Showcasing this on simplytest.me is a great idea! I was planning to set up
bigpipe.wimleers.com
. I'll create abig_pipe_demo
project — or something along those lines, with clear examples of personalization/slowness that really showcases the impact of BigPipe.Then we can have both a simplytest.me link (to show there's zero hacks, that it's easy to set up) and a link to my own demo site, to just see what it feels like.
Question: do you think the demo site used in the screencast on the project page is sufficiently clear? I could easily turn that into a module. Oh, or perhaps a "BigPipe demo" installation profile?
Comment #3
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedBigPipe used to have trouble on simplytest.me - but I never found out why really. I think it had to do with NGINX or Varnish or such.
Comment #4
Wim LeersOh, interesting! I wonder if the
X-Accel-Buffering: no
header that you added fixed that?Comment #5
Wim LeersBTW, the documentation was done in #2621394: Initial README + document relation to Page Cache & Dynamic Page Cache modules. And it's now available, in the beta2 release.
So, this is now just about setting up the demo material.
Comment #6
mgiffordThanks Wim! It's exciting stuff.
Comment #7
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedSimplytest.me does still not support BigPipe / chunked transfer encoding - it always gives back Content-Length, which means the flush() is ignored.
This might be, because Patrick adds some JS to every page by sending a 2nd HTML document after the first one.
Need to ping Patrick on IRC for that.
We should test:
- Acquia DevCloud
- Pantheon
- Platform.sh
Comment #8
patrickd CreditAttribution: patrickd commented1. Launched sandbox on simplytest.me
2. Installed big_pipe module
3. Internal Dynamic Page Cache is already enabled
4. Set Page cache to 1 hour (/admin/config/development/performance)
Response headers contained "Content-Length".
=> Bypassed HAProxy and accessed apache2 vhost directly
Still "Content-Length" in response.
=> Disabled the snippet that is added to every page via php.ini "auto_prepend_file"
Still "Content-Length" in response.
The problem might be the fcgi configuration I use to restrict users within their vhosts.
Is there some simple PHP script for testing this? (that kind of.. tries to use "bigpipe" in a minimal way)
Comment #9
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commented#8:
You will need to be logged in for now or have an open session, but the simplest is to test via curl (in chrome: right-click, copy as curl):
The test.php is like that:
then use:
And you will see that first content, second content, third content are send with 1s in delay.
Edit:
And thanks a lot for looking into this Patrick!
Comment #10
patrickd CreditAttribution: patrickd commentedThanks, that helped a lot to understand the actual problem!
Turning
output_buffering = Off
in php.ini made the example script correctly working when called directlyContent is still buffered somewhere else when directly calling apache2 though.
And as suspected Fcgi is doing some buffering too:
And it works!
so.. let's just try this out and see whether it has any negative impact
This will be deployed within the next hour.
edit: has been deployed on all servers
Comment #11
mgiffordThanks @patrickd & @Fabianx!
Comment #12
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedWorks like a charm now on simplytest.me, now we only need the demo content and profile!
For best effect:
- Enable BigPipe module
- Create an article
- Create a normal user
- Logout
- Login as normal user
- Click on article
- See DPC and BigPipe work together and comment form coming later.
WIN!
Comment #13
Wim LeersNice! This means we should also document
@patrickd I opened #2636930: Document how to disable FastCGI's and IIS' response buffering for that. I don't know anything about FastCGI. Could you confirm that #10 is indeed the best way to solve it? Isn't there some kind of header that can be sent to disable FastCGI's buffering? Or generally speaking: something that doesn't require an
.htaccess
/HTTPD config change? Because not everybody may be allowed to do this.Comment #14
patrickd CreditAttribution: patrickd commentedNo idea, that was the only solution I found, sorry
Comment #15
krlucas CreditAttribution: krlucas commentedI created a Big Pipe demo install profile here:
https://www.drupal.org/sandbox/krlucas/2637020
https://simplytest.me/project/2637020
Not sure if this is what you all had in mind. In addition to an example user and article, it also includes a couple of intentionally slow loading example blocks with configurable max-age. Anyway, happy to help out with some more real world-ish examples!
Comment #16
thpoul CreditAttribution: thpoul as a volunteer commentedCould something like ob_end_flush() help get around it?
Comment #17
Wim Leers#16: no, that's PHP's buffering, not FastCGI's. Anyway, that's now all documented thanks to #2636930: Document how to disable FastCGI's and IIS' response buffering. This issue is now solely about the demoability.
Comment #18
Wim Leersd'oh, I totally forgot about #15… :( I just finished writing a
big_pipe_demo
module that allows the end user to manipulate the slowness (duration) of every block, and even disable BigPipe altogether by just manipulating the URL. It also includes optional (i.e. default) configuration for Bartik.See https://www.drupal.org/project/big_pipe_demo.
Simplytest.me demo: https://simplytest.me/project/big_pipe_demo (don't forget to enable the "BigPipe demo" module). Live demo to follow (having server problems). Here's a link that will work for the next 24 hours: https://dm7r1.ply.st.
Will update the project page momentarily.Project page updated.Comment #19
krlucas CreditAttribution: krlucas commentedRE: #15. No worries Wim! Thanks for all your work. I continue to evangelize D8 Big Pipe any chance I get and your demo is awesome.
Comment #20
Wim Leers@krlucas: I welcome issues that add new blocks. I think in particular your block doing an external web services call would be a great addition. And perhaps your install profile can be changed to use
big_pipe_demo
? Then we all win :)