Support » Theme: Hueman » Slow performance on front page

  • emmz0r

    (@emmz0r)


    Hi! Fantastic theme but after the update to the new theme, my page’s performance got lowered drastically. I did some profiling, and it seems like the front page gets every individual article in separate http requests, and all these add up before the page loads. Loading time has gone up to 6 seconds. Did this change from the older versions?

    Also when posting links to other articles in the same wordpress, it embeds them. It looks very nice but the same problem is here – a full http load of the entire article for each embed.

    Any solution for this? Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Denzel Chia

    (@denzel_chia)

    Hi,

    You can use a cache plugin in Hueman theme to speed up loading.
    http://docs.presscustomizr.com/article/243-speed-up-the-hueman-theme-how-to-setup-w3-total-cache-plugin

    You can go to Appearance -> Customize -> Global settings -> Performances and SEO
    Check all the settings available.
    It will help to speed up your site loading.

    As for your second issue.
    You can try out this plugin.
    https://wordpress.org/plugins/disable-embeds/

    Thank you

    emmz0r

    (@emmz0r)

    Hi and thanks! W3 total cache has “dumb” caching. No emptying cache for specific pages that you update and that automatically updates the front page etc. So it’s useless unfortunately.

    Minified stylesheets are already on. The main issue is the front page, which gets all the individual articles as separate HTTP requests. I would have expected a query for all the articles in one batch…

    Denzel Chia

    (@denzel_chia)

    Hi,

    The main issue is the front page, which gets all the individual articles as separate HTTP requests. I would have expected a query for all the articles in one batch…

    Please show me how you determine this.

    The theme is using standard WordPress loop.
    https://themes.trac.wordpress.org/browser/hueman/3.2.10/index.php#L19
    If this is a problem, then even the default WordPress theme has the same problem.

    Please suggest how it should be written.

    Thank you

    emmz0r

    (@emmz0r)

    The theme gets 3 articles with all embeds in them (incl. youtube) on the front page. So the front page is as slow as all the articles added up with all they contain. I used Query Monitor plugin to figure this out. To reproduce, have a few articles with embeds to other articles and youtube videos on the front page.

    WP_Http->get()
     wp-includes/class-http.php:594
    wp_safe_remote_get()
     wp-includes/http.php:70
    WP_oEmbed->_fetch_with_format()
     wp-includes/class-oembed.php:498
    WP_oEmbed->fetch()
     wp-includes/class-oembed.php:474
    hu_embed_html()
     wp-content/themes/hueman/functions/init-wp-core-filters.php:49
    apply_filters('embed_oembed_html')
     wp-includes/plugin.php:235
    WP_Embed->shortcode()
     wp-includes/class-wp-embed.php:239
    WP_Embed->autoembed_callback()
     wp-includes/class-wp-embed.php:357
    preg_replace_callback()
     wp-includes/class-wp-embed.php:357
    WP_Embed->autoembed()
     wp-includes/class-wp-embed.php:339
    apply_filters('the_content')
     wp-includes/plugin.php:235
    wp_trim_excerpt()
     wp-includes/formatting.php:3274
    apply_filters('get_the_excerpt')
     wp-includes/plugin.php:235
    get_the_excerpt()
     wp-includes/post-template.php:397
    the_excerpt()
     wp-includes/post-template.php:362
    load_template('~/wp-content/themes/hueman/content.php')
     wp-includes/template.php:574
    locate_template()
     wp-includes/template.php:531
    get_template_part('content')
     wp-includes/general-template.php:167

    …. happening n times …

    WP_Http->get()
     wp-includes/class-http.php:594
    wp_safe_remote_get()
     wp-includes/http.php:70
    WP_oEmbed->discover()
     wp-includes/class-oembed.php:388
    WP_oEmbed->get_provider()
     wp-includes/class-oembed.php:247
    hu_embed_html()
     wp-content/themes/hueman/functions/init-wp-core-filters.php:48
    apply_filters('embed_oembed_html')
     wp-includes/plugin.php:235
    WP_Embed->shortcode()
     wp-includes/class-wp-embed.php:239
    WP_Embed->autoembed_callback()
     wp-includes/class-wp-embed.php:357
    preg_replace_callback()
     wp-includes/class-wp-embed.php:357
    WP_Embed->autoembed()
     wp-includes/class-wp-embed.php:339
    apply_filters('the_content')
     wp-includes/plugin.php:235
    wp_trim_excerpt()
     wp-includes/formatting.php:3274
    apply_filters('get_the_excerpt')
     wp-includes/plugin.php:235
    get_the_excerpt()
     wp-includes/post-template.php:397
    the_excerpt()
     wp-includes/post-template.php:362
    load_template('~/wp-content/themes/hueman/content.php')
     wp-includes/template.php:574
    locate_template()
     wp-includes/template.php:531
    get_template_part('content')
     wp-includes/general-template.php:167

    It even causes 404s

    • This reply was modified 4 years ago by emmz0r.
    • This reply was modified 4 years ago by emmz0r.
    Denzel Chia

    (@denzel_chia)

    Hi,

    Thank you for your reply.
    Now I understand your issue.

    To reproduce, have a few articles with embeds to other articles and youtube videos on the front page.

    Any type of embed, whether it’s youtube iframe code or WordPress converting URL to oembed code
    https://codex.wordpress.org/Embeds

    It’s the browser which “sees” this embed code and do a request for the video or content.
    You can view your web page source code and see those YouTube URLs in your content.
    Therefore for every embed code, you will get a http request to the video provider.
    This is how it works, I don’t see anything wrong with it.

    What you see in the query monitor, is WordPress filtering the content and converting URL to oembed.
    https://codex.wordpress.org/Embeds
    https://make.wordpress.org/core/2015/10/28/new-embeds-feature-in-wordpress-4-4/

    It’s filtering the content, which means it runs for every content in the WordPress loop. The WordPress loop is used in template, not something before the web page loads.
    It’s call a loop because it’s recursive, which is why you see the same class and function getting executed more than once.

    If you want to remove WordPress oembed, here is a thread discussion on how to remove it.
    https://wordpress.org/support/topic/how-to-disable-auto-wordpress-emmed-script/

    This has nothing to do with Hueman theme. If you think WordPress is doing this wrongly, you can open a ticket at WordPress’s trac and let them know. It will be much better if you can show them how you think it should be done.

    https://make.wordpress.org/core/handbook/tutorials/trac/opening-a-ticket/

    Thank you

    emmz0r

    (@emmz0r)

    Thanks!

    I don’t really want to disable youtube embeds etc. They look nice. But I am surprised that this behaviour is not optimized by WordPress… I embed by just pasting the URL, and wordpress does the rest, as for links to articles.

    There has to be a more performant way to produce a front page with existing APIS?

    I have the same problem. When using Hueman 3.1.3, my front page was generated very quickly, and after upgrade to Hueman 3.3.9, my front page was generated from 11 to 21 seconds. To verify this slow problem, I switch back to 3.1.3, front page is back normal and very quick.

    Only front page (hueman index.php) has this problem, single page is fine in Huemen 3.3.9.

    WordPress is 4.7.4

    How can I debug?

    Facing the same issue that its taking almost 6 sec for loding the home page,
    as the theme is good but how can i solve this problem,
    plz help me out,
    i have gone through plugins and all other things but still its not working fine,
    do any one have solution for this.

    I have got the same problem as well. It takes 11-20 sec to generate front page @ toogeza.com

    What should I do in order to solve this isssue?

    We found that Hueman theme sends a lot of http requests to youtube which are slowing down the loading process dramatically. Each request takes almost 0.5sec and there are plenty of them!

    Here is screenshot of one of this requests -> http://take.ms/gm3fX
    The page URL we test is here https://toogeza.com/category/kids-and-computers The thing is that there is no obvious videos embeded in that view, but certainly this videos are from posts under this category /category/kids-and-computers

    How to swicth off this kind of prefetch preloading?
    Main page has 20 of such http reguests to youtube and each one takes 0.5sec to get!
    Please, help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Slow performance on front page’ is closed to new replies.