Site logo

[Support request] Does Back-To-Top on WP-Rocket cached site require exclusions?

Home Forums Support [Support request] Does Back-To-Top on WP-Rocket cached site require exclusions?

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1528116
    Dajuan

    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/

    #1528600
    David
    Staff
    Customer Support

    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

    #1528687
    Dajuan

    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.

    #1528692
    David
    Staff
    Customer Support

    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’

    #1528739
    Dajuan

    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?

    #1529023
    David
    Staff
    Customer Support

    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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.