Page loading time issue

Hello guys, I hace a problem in one of my website (lesmeilleursvaporisateurs.com): when browsed, it seems pretty fast to load, but the pages stays white for a second or two, before rendering the content.

I try to inspect with the various browser developer tools, but I can't identify the issue.

Thanks.

  • Adam Czajczyk

    Hi luigi

    I hope you're doing fine today!

    I have visited the site and I see what you mean. The site's rendering really fast indeed but there's around a second "delay" where the "white screen" is all I see.

    I took a look "under the hood" using browser console (and I also tested site using Pingdom tools and GTMetrix - results are quite impressive) and I noticed two things that bother me a bit:

    1. while the site seems to be really nicely optimized the "cookiebar" plugin (I don't know what exactly are you using but I mean the plugin that displays cookie notice on the site) seems to be trying to load some "geoip" service from time to time and that service actually returns "ERR_CONNECTION_ERROR".

    This might be related because if that's not loaded "asynchronously" (or in "parallel") that might cause significant render delay. You could try disabling that plugin temporarily, clearing all the caches on site if you got any and checking if that helps. If so, it might be a good idea to look for some other plugin of that kind to replace it.

    2. Having said that, I think the more likely reason is actually the TTFB (Time To First Byte) delay. If you look at the loading times (e.g. in Chrome browser console or via Pingdom tools) you will notice that while all the resources are being loaded in parallel (which is a good thing), the first response from server comes after nearly a second.

    If that's not caused by the plugin mentioned in point 1, then it gets a bit more complex. In that case, full-page caching might help minimize it (e.g. Page Cache of our Hummingbird, W3 Total Cache etc), but I'm guessing you already may have that installed (taking page speed into account). If not, give it a try.

    Then, it's worth considering implementing CDN (even a free plan of CloudFlare is a good idea) as it might significantly minimize the issue.

    But if none of that works then it might turn out that the only solution would be to actually... change the host as this might be caused by simply db engine or webserver not being able to serve the request queue fast enough (the resources are always somehow limited so that might be a bottleneck).

    Best regards,
    Adam

  • luigi

    Hi Adam, thanks for the extensive answer.
    I deactivate the cookie bar plugin (which I had installed indeed), but it doesen't seems to get better.

    One thing thata I notice: when I clear the cache (wp super cache for page cache & hummingbird for optimization), the first loading after that seems to go with no delay.
    After the first browsing, the delay comes back.

    Now the plugin is still deactivate, can you confirm that the delay is still present?

    Thanks

  • Adam Czajczyk

    Hey luigi

    Yes, I can confirm that there's still delay.

    From what you found, it might be yet another issue with a bit of "overoptimization". You have posted this in Members' only forum so I'm not able to access and check your site but since Hummingbird is involved, I'd be happy to take a closer look.

    If want me to do this, please enable support access to the site by going to the "WPMU DEV -> Support" page in site's back-end and clicking on "Grant Support Access" button there and let me know here if you want me to move this entire thread from Members forum to Support forum (as it's the only way I could actually make use of Support Access - it's not available for me here on Members forum).

    Best regards,
    Adam

  • Adam Czajczyk

    Hi luigi

    Thanks for enabling access.

    I checked the site and the configuration seems fine there, nothing seems to be "over optimized", unlike I expected.

    I've run some more tests and while I couldn't see the site loading instantly after clearing cache, I noticed something interesting. When I enabled uBlock on my Firefox, the site started to load instantly there. I've tested it multiple times and with uBlock (sort of AdBlock add-on) there's no "white screen" but with it disabled - there is.

    So, that made me think that there are actually some resources that are "blocking rendering" even though they don't seem to be detected by the tools like PageSpeed, GTMetrix or Pingdom. uBlock reports only resources coming from following domains as blocked:

    facebook.net
    fonts.googleapis.com
    google-analytics.com

    With uBlock disabled, they are not blocked and the site loads with "white screen" while when they are blocked, site loads instantly. This leads me to the point that some of them might not actually be loading "asynchronously" or the might not be rendering "in background".

    With that in mind I reviewed the site again but I must say I wasn't able to "drill down" into much more details. Facebook scripts are known to work fine in most cases so if I was about to bet, I'd rather investigate the other two.

    I noticed that you're loading Google Analytics code in the head of the site, at the very beginning. I think that would be the first thing I'd check but I'm not sure how the code was added there. I see that it's supposed to be asynchronous but that doesn't necessarily works like that. I think that it might be worth a short to remove that code, clear all caches and then test site again - if that makes a difference, it might be good to look for some plugin to handle Analytics code or try to tweak that code. The code that's currently on the site doesn't seem to follow guides here:
    https://developers.google.com/analytics/devguides/collection/analyticsjs/

    You can see it if you look closer at the source code of your homepage - it's different and the "main" snippet there seems to be the one that "has the disadvantage of not allowing modern browsers to preload the script.".

    I think that's the culprit here. If not, examining how the google fonts are loaded would be a next step but that might actually be much more difficult to find/overwrite as (I assume) they're probably coming from theme/Visual Composer, thus being rather hard or even impossible to modify.

    Best regards,
    Adam

  • Adam Czajczyk

    Hello luigi

    I'm happy I could help and I'm glad the site's now performing well.

    As for the other site, I assume you have already double-checked it against the same (google analytics scripts) issue and in this case it didn't help, correct?

    A quick check following the same path as with the previous site now shows the googletagmanager.com assets as "blocking" so that might be the issue here. Like previously - I'd suggest starting with testing this one - removing it, clearing all caches and checking if that helps. Then depending on whether it does help or not we'd decide what to do next (look for solution for the code or investigate further). Could you check it please?

    Best regards,
    Adam

  • luigi

    Ok, deleting this piece of script

    <script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
    h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
    (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
    })(window,document.documentElement,'async-hide','dataLayer',4000,
    {'GTM-TQH6JPQ':true});</script>

    and now runs well. It seems the fb pixel code.

    Edit: is the google tag manger

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.