-
Notifications
You must be signed in to change notification settings - Fork 27
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
Update callback priority on template_redirect for picture display #891
Update callback priority on template_redirect for picture display #891
Comments
I tested when using RocketCDN here: https://new.rocketlabsqa.ovh/next-gen-image/ |
Blocked pending product decision on the feedbacks from QA. |
Feedbacks from QA on the PR need to be investigated then handled. this is not a priority compared to 3.17 os moving this back to Needs Grooming and outside of the sprint. |
@Khadreal Do you have an update on this grooming? Thanks! |
Would revert later today, the LL is not excluded if it's picture display and cdn is on.
|
After debugging with @wordpressfan, we discovered that the issue is related to the speed between RocketCDN and WPR. We’ll be submitting another PR to WPR to address this. During lazy loading, the URL in the
|
Thanks @Khadreal. Assigning to you and moving to In Progress then. |
is there some way I can help with that? |
I think the challenge here is with the rocketcdn plugin as a standalone, it's using template_redirect which is conflicting with imagify process. I'm thinking of one of the solution |
We can update the priority used in the RocketCDN plugin too, to make sure everything executes in the order we need |
The priority is in the right order though in RocketCDN |
@wp-media/qa-team to test the PRs for this issue please follow this
WPRocket + Imagify |
2nd round of tests using WPR and imagify in sheet 2 here https://docs.google.com/spreadsheets/d/1YpkRpc_PkcszOezpkIooWC6hIWnkIWnXITvoHNjEjIo/edit?gid=1626911531#gid=1626911531 , waiting PO decision if we need to do further fix here https://wp-media.slack.com/archives/CUKB44GNN/p1728893947213469 |
as per discussion with @piotrbak we are good to proceed with the current state and for C7 , clear priority elements will fix that |
Context
Related to wp-media/wp-rocket#6786
WP Rocket Lazyload exclusion is not working correctly when excluded pattern is part of a
picture
element created by the picture rewriting feature of Imagify.Expected beavhior
Lazyload exclusion should work as expected
Additional information
So I believe I found what was happening with the next-gen issue. we have 2 callbacks on
template_redirect
:So we should expect imagify to be finished first, and WP Rocket after. BUT, both callbacks have an
ob_start()
call, and when multiple are called, they become nested until the buffering stops:When output buffering ends (on shutdown action of WP), lower level content is passed to upper, so the order becomes WP Rocket optimizations first, then Imagify second, and HTML is output.
While callback priority is as expected, the output buffering works in the opposite order.
To verify, I tested by changing the priority of Imagify callback to 10, reverting both orders, and it works as expected, the picture element is applied first in the HTML, and then lazyload exclusion works as needed.
The text was updated successfully, but these errors were encountered: