Join the community today
Become a Member

Cloudflare Origin Server Location & Argo and other Optimizations for Pagespeed Insights

Discussion in 'Web Development & Web Performance' started by negative, Nov 22, 2019.

  1. negative

    negative Active Member

    358
    40
    28
    Apr 11, 2015
    Ratings:
    +82
    Local Time:
    9:15 PM
    1.9.10
    10.1.11
    Hello

    Website (big xenforo board) works very fast for visitors already
    (for example webpagetest.org score is grade A, page load times around 100ms if guest page cached about 60ms from tools)

    but;

    I'm getting many error on webmasters tools console about mobile page load time above of 300ms + and mobile score is around 42-46. Anyway desktop score is about 98-99 and there is no page load time error.

    I'm using everything like cloudflare pro plan & caching (cloudflare cdn caching, zend, redis cache etc. ) even cloudflare rocket loader enabled.

    but main concern is google doubleclick/adsense scripts i thought.

    And i'm thinking to switch the Argo on cloudflare for decrease load times but it is not exaclty solution for decrease load times.

    Also, i have a question if anyone know. How important the origin server location (distance) to cloudflare servers on decrease the page loads? For example, a visitor when the call a page from Turkey and if webserver in Turkey, cloudflare what does do? All requests goes to main cloudflare DNS servers ( i thougt they are in USA ) and cloudflare redirecting back to ISTANBUL (Turkey) server's then our server. So maybe time losing on this distance. Actually i'm thinking also that move the our webserver to like USA or Europe.

    What do you advice and what is your opinions? Thanks

    Ekran Resmi 2019-11-22 10.40.32.png
     
    Last edited: Nov 22, 2019
  2. eva2000

    eva2000 Administrator Staff Member

    42,262
    9,550
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,708
    Local Time:
    5:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Google Webmaster Console adding a new Speed Report which also evaluates and displays page speed based on First Contentful Paint (FCP) and First Input Delay (FID) Official Google Webmaster Central Blog [EN]: Get faster with the new Speed report in Search Console which is based on Google PageSpeed Insights v5 and CrUX Chrome User report metrics which are real user based. So geographic distance and physics of network distance factor into page speed by real users. If your real visitor is on a slow 3G 1.6Mbps mobile connection and you have 1200KB sized page, it takes in theory 1200/204 = 5.88 seconds to download excluding any network overhead, packet loss, and mobile device related factors (slow cpu etc = slower javascript parsing and execution). No Cloudflare acceleration will make physics of it all any faster for that particular 3G slow mobile user.

    Sure CF can help with reduce size of images on mobile i.e. Mirage so that 1200KB sized page may end up at 900KB after image optimisations. But still 900/204 = 4.41 seconds. In theory you’d need for a page size + ads + external scripts to not total more than 400KB for it to hit reasonable metrics for 3G mobile speed test.

    Google PageSpeed Insights tests your site’s theme/layout as well and how it’s put together which Cloudflare can only partially help with. The rest is on your and/or your web developers/theme/layout choices.

    Google PageSpeed Insights v5 is heavily weighted towards interactive and speedindex and first contentful paint metrics on 3G moto g4/nexus 5 device emulation. So for dynamic and javascript heavy sites, 3G mobile score or heavily render blocked asset based sites, the score will be lower. From v5 API this is the weighting used to determine the score
    • interactive 5
    • speed-index 4
    • first-contentful-paint 3
    • first-cpu-idle 2
    • first-meaningful-paint 1
    You really shouldn’t look at the overall scores but the metric’s values measured over time to get your relative page speed. Field data origin summary would be that over time measurement rather than the lab data scores which is what the score rating is measured from.

    My write up on PageSpeed Insights v5 update at https://community.centminmod.com/threads/google-pagespeed-insights-v5-update.16016/

    For pagespeed tests, also use webpagetest.org for pagespeed testing - my guide at https://community.centminmod.com/th...getest-org-for-page-load-speed-testing.13859/

    According Chrome Dev Summit talks/slides looks like in January 2020, Google Lighthouse v6 will be released so Google PageSpeed Insights v6 will be out too. They are adjusting the weighting and adding new metrics for the Pagespeed score - moving First Contentful Paint (FCP) to a higher weighting than it has in Google PageSpeed v5 and also adding a Total Blocking Time (TBT) and Largest Contentful Paint (LCF) metric https://twitter.com/bunopus/status/1193999246812278784. Both First CPU Idle and First Meaningful Paint (FMP) metrics are being removed.

    Actual Google Dev Summit 2019 Youtube session that talks about this is here.

    According to data compiled by Web Almanac 2019 By HTTP Archive 1, First Contentful Paint (FCP) metric is highly influenced by the type of device (desktop/mobile), ISP connection speed and geography
     
  3. eva2000

    eva2000 Administrator Staff Member

    42,262
    9,550
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,708
    Local Time:
    5:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  4. eva2000

    eva2000 Administrator Staff Member

    42,262
    9,550
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,708
    Local Time:
    5:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Pagespeed is still geographically dependent. This is due to Cloudflare not caching HTML content by default but only static files. So for optimal TTFB speed, you want your origin real web server to be hosted in a location closest to your majority traffic visitors and then put Cloudflare in front. For instance, my forums has 50% US visitors 40% Asian visitors and 10% Oceania. So my optimal geographic location for my origin is US West Coast as it sits in middle of US, Europe and Asian so equal round trip times for majority of visitors.

    Cloudflare cache certain static content https://support.cloudflare.com/hc/en-us/articles/200172516-Which-file-extensions-does-Cloudflare-cache-for-static-content- but not dynamic/static generated html itself by default (which is what WPT TTFB is testing for). But you can tell Cloudflare to cache dynamic/static generated html content to some extent depending on Cloudflare plan you’re on via cache everything page rule but have to be careful to only do this for static html content and not dynamic html content (otherwise you would cache private logged in user content).
     
  5. eva2000

    eva2000 Administrator Staff Member

    42,262
    9,550
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,708
    Local Time:
    5:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    You can also use Cloudflare Browser Insights https://blog.cloudflare.com/introducing-browser-insights/ and Google Analytics pagespeed data to drill into your CF accelerated web site’s analytic and page speed metrics and see which geographic region/pages are slow for you as well and which areas pull down your averages, median and percentile values for page speed.
     
  6. negative

    negative Active Member

    358
    40
    28
    Apr 11, 2015
    Ratings:
    +82
    Local Time:
    9:15 PM
    1.9.10
    10.1.11
    Then after read, I thought the best way to decrease load time that decrease the page size.

    In this mean, xenforo 2 is shallow because of it calls css.php dynamically and also we can't prevent/fix the render-blocking scripts.

    Actually i was wondering the origin server location espcially because we have about 90% of visitors from same country and webserver hosting from that country. so it is right. But our location (Turkey) looks very far to cloudflare DNS servers as well.

    And other main factor is doubleclick/adsense scripts as well. Website takes very very high scores if we don't have that ad codes :) But after put them, pagespeed insights scores decreasing as on all of websites in the web i thought. Anyway, visitors don't slow down (actually i m testing the website on my phone, 3g network, wifi network etc and looks very fast) i thought but we take stamp as slow website on pagespeed insights due that ad codes i think so.
     
  7. eva2000

    eva2000 Administrator Staff Member

    42,262
    9,550
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,708
    Local Time:
    5:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Google Adsense will definitely slow pages according to PageSpeed Insights but is necessary if you want to earn $$$$

    psi-3rd-party-adcode-02.png
     
    • Agree Agree x 1
  8. eva2000

    eva2000 Administrator Staff Member

    42,262
    9,550
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,708
    Local Time:
    5:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    haha trying getting FCP under 1 second = 1000ms with these Google Adsense/Facebook scripts !

    This was webpagetest.org Google Lighthouse test on 3G Fast 1.6Mbps profile with Nexus 5 mobile device

    wpt-lighthouse3rd-party-adcode-01.png
     
    • Winner Winner x 1
  9. negative

    negative Active Member

    358
    40
    28
    Apr 11, 2015
    Ratings:
    +82
    Local Time:
    9:15 PM
    1.9.10
    10.1.11
    Hope, Google considers their Ad Servers in future updates on pagespeed insights then!