wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

Preload doesn’t stop when asked to

Open Screenfeed opened this issue 4 years ago • 22 comments

Describe the bug The "Stop preload" button doesn’t stop the preload when sitemap preloading is enabled.

To Reproduce Steps to reproduce the behavior:

  1. Choose a site with a "large" number of pages
  2. In the Preload section from WPR’s settings, enable preloading + sitemap-based cache preloading, and fill in the sitemap URL.
  3. Once the settings saved, hit the "Preload cache" button from the admin bar or in the quick actions sidebar from WPR’s settings page.
  4. The banner displaying the number of paged that have been preloaded will appear.
  5. Hit the "Stop preload" button.
  6. 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

Screenfeed avatar Mar 10 '20 13:03 Screenfeed

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 avatar Mar 16 '20 16:03 Screenfeed

@Screenfeed Before to plan a complete rewrite, do we have a solution which will work with a slower effort?

GeekPress avatar Mar 17 '20 14:03 GeekPress

@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.

Screenfeed avatar Mar 17 '20 14:03 Screenfeed

Another case: https://secure.helpscout.net/conversation/1125854331/155259?folderId=377611

webtrainingwheels avatar Apr 06 '20 19:04 webtrainingwheels

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.

jazir555 avatar Apr 18 '20 03:04 jazir555

I can confirm the same. Preload isn't stopping in a large site with lots of pages.

evagabond avatar Apr 22 '20 20:04 evagabond

Another case: https://secure.helpscout.net/conversation/1155046039/162715?folderId=3051575

viobru avatar May 05 '20 09:05 viobru

@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.

hellofromtonya avatar May 11 '20 11:05 hellofromtonya

Another ticket: https://secure.helpscout.net/conversation/1162851074/164717?folderId=2135277

vmanthos avatar May 13 '20 12:05 vmanthos

Another ticket: https://secure.helpscout.net/conversation/1169041464/166247/

kierantaylorio avatar May 19 '20 13:05 kierantaylorio

This issue will be fixed in a future major release. It's blocked until the new Preload is built.

hellofromtonya avatar May 24 '20 11:05 hellofromtonya

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

gevcen avatar Mar 06 '21 19:03 gevcen

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 .

jazir555 avatar Mar 06 '21 20:03 jazir555

Or at least please provide us a workaround to stop it somehow in the meantime

gevcen avatar Mar 07 '21 18:03 gevcen

@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 avatar Mar 09 '21 10:03 GeekPress

@GeekPress

Do you have a projected ETA for the remove unused css feature?

jazir555 avatar Mar 09 '21 10:03 jazir555

@jazir5 I can't provide any ETA as well.

GeekPress avatar Mar 12 '21 17:03 GeekPress

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/

iCaspar avatar Aug 20 '21 16:08 iCaspar

@orrburgel workaround that worked for me: disactivate auto-preload when you finished your testing configuration, re-enable it back

gevcen avatar Aug 20 '21 17:08 gevcen

Another case: https://secure.helpscout.net/conversation/1652233228/299529/

juricazuanovic avatar Oct 06 '21 13:10 juricazuanovic

Related - https://secure.helpscout.net/conversation/1878847753/342181?folderId=3864735

DahmaniAdame avatar May 11 '22 09:05 DahmaniAdame

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

JerissCloudCenter avatar Aug 04 '22 09:08 JerissCloudCenter

The issue is not relevant with the 3.12 preload implementation, as the preload now is an ongoing process.

piotrbak avatar Aug 30 '22 10:08 piotrbak