wp-rocket
wp-rocket copied to clipboard
Preload doesn’t stop when asked to
Describe the bug The "Stop preload" button doesn’t stop the preload when sitemap preloading is enabled.
To Reproduce Steps to reproduce the behavior:
- Choose a site with a "large" number of pages
- In the Preload section from WPR’s settings, enable preloading + sitemap-based cache preloading, and fill in the sitemap URL.
- Once the settings saved, hit the "Preload cache" button from the admin bar or in the quick actions sidebar from WPR’s settings page.
- The banner displaying the number of paged that have been preloaded will appear.
- Hit the "Stop preload" button.
- The same banner should still be displayed with the same button: preloading didn’t stop.
Expected behavior Preloading should stop and the result banner should appear.
Source of the bug
The reason of this bug is quite simple: the "stop" action only cancels the homepage preloading, not the sitemap preloading. See WP_Rocket\Engine\Preload\PreloadSubscriber->do_admin_post_stop_preload()
:
https://github.com/wp-media/wp-rocket/blob/e154e170c205534398247e935cc5eaef070eaeeb/inc/Engine/Preload/PreloadSubscriber.php#L360-L374
Backlog Grooming
- [x] Reproduce the problem
- [x] Identify the root cause
- [x] Scope a solution
- [x] Estimate the effort
I guess it is time to separate homepage preload, sitemap preload, and everything that is common to both (like admin notices).
It will probably end up with PreloadSubscriber
, HomepagePreloadSubscriber
, and SitemapPreloadSubscriber
. We could also create an interface for homepage and sitemap subscribers, to harmonize things. The main class PreloadSubscriber
would trigger hooks that homepage and sitemap subscribers would use.
Effort: [M]
.
@Screenfeed Before to plan a complete rewrite, do we have a solution which will work with a slower effort?
@GeekPress It is not a complete rewrite. Basically, it is splitting the class PreloadSubscriber
into 2 classes with different concerns instead of piling up another bandage.
The other solution is to add another dependency to the class PreloadSubscriber
, which will be refused during the review.
Another case: https://secure.helpscout.net/conversation/1125854331/155259?folderId=377611
Can confirm i am experiencing the same issue on my production sites. Preload is uncancelable via the stop preload button if sitemap preloading is enabled.
I can confirm the same. Preload isn't stopping in a large site with lots of pages.
Another case: https://secure.helpscout.net/conversation/1155046039/162715?folderId=3051575
@GeekPress This issue will be fixed in the new Preload module in 3.7. We aren't able to fix it until we do the rewrite/refactor.
Another ticket: https://secure.helpscout.net/conversation/1162851074/164717?folderId=2135277
Another ticket: https://secure.helpscout.net/conversation/1169041464/166247/
This issue will be fixed in a future major release. It's blocked until the new Preload is built.
Still no update on this bug? if the new preload module will take time, you should at least fix this bug and make the button work. Thanks
The preload update was scheduled for 3.7 and the project date was like July of last year. I think they just gave up on preload.
On Sat, Mar 6, 2021, 11:59 AM gevcen [email protected] wrote:
Still no update on this bug? if the new preload module will take time, you should at least fix this bug and make the button work. Thanks
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wp-media/wp-rocket/issues/2404#issuecomment-792042919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSHPL5SGSWNY5EYOZJ5SZDTCKCTVANCNFSM4LE7CFSQ .
Or at least please provide us a workaround to stop it somehow in the meantime
@gevcen No update until you will see a milestone set up on this issue. As you may know, we are fully focused on Remove Unused CSS for few months. We can't work on our 410+ issue at the same time, we have to prioritize.
Thanks for your comprehension.
@GeekPress
Do you have a projected ETA for the remove unused css feature?
@jazir5 I can't provide any ETA as well.
Hey there @orrburgel Thanks for letting us know about this. Sounds like you might need some more immediate support to troubleshoot. We can't provide direct support here, but our support team would be happy to look into this with you. https://wp-rocket.me/support/
@orrburgel workaround that worked for me: disactivate auto-preload when you finished your testing configuration, re-enable it back
Another case: https://secure.helpscout.net/conversation/1652233228/299529/
Related - https://secure.helpscout.net/conversation/1878847753/342181?folderId=3864735
Will this be fixed as part of the New Preload Module ?
It was supposed to be the case as mentioned in https://github.com/wp-media/wp-rocket/issues/2404#issuecomment-626641823
The issue is not relevant with the 3.12 preload implementation, as the preload now is an ongoing process.