Site logo

Archived topic

Does Back-To-Top on WP-Rocket cached site require exclusions?

5 replies · Started by Dajuan on November 12, 2020

Viewing posts 1–6 of 6

Hi GeneratePress team,

I'm running the latest version of GP along with WP-Rocket. On mobile specifically, the back-to-top button requires several presses before the user is taken back to the top. If I clear and de-activate WP-Rocket (and SiteGround memory caching) I do not have this issue. Is there a CSS/JS file that may need cache/minification/etc exclusion for optimal back-to-top button functionality on my site (mobile-specific)?

https://www.inhisimagephotography.com/

Hi there,

not come across that issue before.
You can try excluding: back-to-top.min.js

Its relative path is:

/wp-content/themes/generatepress/assets/js/back-to-top.min.js

Thank you. I've excluded back-to-top.min.js based on the relative path, however, the issue persists. Seems the display/screen needs to be clicked a time or two before the button activates.

If there are any other scripts I should consider, please share.

I'll continue testing in the meantime.

I think the issue is because JS is being deferred.
Can you troubleshoot WP Rocket by disabling its options to see which one is causing the 'conflict'

Thank you! WP Rocket recently enabled a feature called "Delay JavaScript execution". I provided a screen capture below. It has some default JS inclusions, but I don't see anything GP related. However, if I disable this feature the back-to-top functionality isn't interrupted.

WP Rocket's Delay JS Execution Feature

I'm going to reach out to the WP Rocket team about this.

Is there anything in WP Rocket's default list of inclusions that is related to the back-to-top functionality?

Theres nothing in that list related to any GP script - they are all scripts that are loaded from a 3rd party resource - which it is common to defer / delay.
What it looks like is the loading of Delayed Scripts has been bound to interactive events such as onClick, so the first couple of clicks is what triggers them to load. Meaning the poor old back to top doesn't get a look in until they're loaded.

This archived topic is closed to new replies.