-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Only apply output buffer filter when in final phase #62770
base: trunk
Are you sure you want to change the base?
Only apply output buffer filter when in final phase #62770
Conversation
Co-authored-by: Roland Soos <[email protected]>
@nextend I'm having a hard time triggering a scenario in which |
I tried adding a test case in WordPress/performance#1317 but I'm not having success. |
Here is an example that can trigger the https://bitbucket.org/rolandsoos/workspace/snippets/aq7bnz |
@nextend Thanks for providing that test case. Sorry for the delay in responding. To be honest I've been having a hard time wrapping my brain around this. I've iterated on the corresponding PR in the WordPress/performance repo and I'm getting closer but I'm still perplexed why it isn't behaving as expected. Could you take a look? https://github.com/WordPress/performance/pull/1317/files |
@westonruter I think the missing piece is to call On line 91, a new output buffer is created. This output buffer is necessary as it allows you to access the output in the same way the PHP runtime does when outputting the default output buffer. In the original code, the following happened:
In the new code:
|
@nextend Thank you. I iterated on it a bit more with your change applied and I think it's in a good shape: WordPress/performance#1317 |
As suggested by @nextend in a follow-up to #61212: