Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Long LPC and TTFB

  • Hi guys – I’m getting fine page scores but the LCP is high for both mobile and desktop. Any ideas why? For a long time it was fine, but now it suddenly has increased and I cannot figure it out.

    Thanks.

  • Hi there,

    PSI shows that a chunk of the cause is a high TTFB(Time To First Byte). Since your images are preloaded, and your resources are already optimized with WP Rocket, one possible reason for this issue is your Server.

    If you’re not using a CDN yet, could you try using one to test? This article may be insightful: https://www.wpbeginner.com/showcase/best-wordpress-cdn-services/

  • Hi Fernando, thanks for the reply. I have a really fast cloud server setup, not shared hosting, and use a CDN. If you have any other ideas, please let me know. Thanks 🙂

  • Hi there,

    for the lazy loading, thats correct you should skip any lazy loading for images that are above the fold.

    I ran a few pagespeed tests on the links you provided, and the results across the tests are somewhat inconsistent, in some instances Google failed to provide any real diagnostics as to the failing FCP times.

    Running performance tests in the browser, i have to really throttle network and CPU to exaggerate any issues. And the main one i see is a TTFB and Load Time delay on things such as the LCP image.

    As there is very little else to go on – I would have a chat with the CDN Provider to see if they can run some diagnostics on TTFB times.

  • I seemed to have figured it out by getting the CDN to do a better job. My only question is preloading images. I preloaded the image on the single posts page using this:

    https://generatepress.com/forums/topic/image-optimization-on-mobile-lcp/#post-1682167

    It’s working, however for some reason GPSpeed still says to preload the image even though I can verify that it is preloaded in the header.

    But, on the homepage I can’t seem to get it working for the hero element. Was trying something like this:

    add_action( ‘wp_head’, function(){
    if ( is_front_page()) {
    $featured_img_url = get_the_post_thumbnail_url(get_the_ID(),’full’);
    echo ‘<link rel=”preload” as=”image” href=”‘.$featured_img_url.'”/>’;
    }
    });

    add_filter( ‘generate_hero_thumbnail_id_size’, function() {
    return ‘large’;
    } );

  • I don’t see the featured image being preloaded on your homepage.

    As your code doesn’t have the format, I can not tell if there’s any error.

    Just make sure it’s the same as the below code:

    add_action( 'wp_head', function() {
        if ( is_front_page() ) {
            $featured_img_url = get_the_post_thumbnail_url( get_the_ID(), 'full' );
            echo '<link rel="preload" as="image" href="' . $featured_img_url . '"/>';
        }
    });

    And is the page hero image the featured image of the home page?

  • Awe you solved it for me. I didn’t set the featured image. Now that it’s set the code can grab it and preload it for the hero image. Thanks!

  • You are welcome   🙂

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