Discover Centmin Mod today
Register Now

DNS WebPerf Cloudflare PageSpeed Make my sites looks like localhost

Discussion in 'Web Development & Web Performance' started by Eduardo, Jun 15, 2020.

  1. Eduardo

    Eduardo Member

    38
    3
    8
    Feb 7, 2015
    Ratings:
    +5
    Local Time:
    3:50 PM
    1.7.9
    hello,

    I'm experienced webdeveloper and I know all on page otimizations to make my pages fly faster than speed of light, but now I'm trying to make the same experience on the server side.

    I host tons of small websites (almost 100% are pure html) and I want to make them rocket load to make my customers more happy.

    For now what I have:
    1) running on cloudflare DNS (by far, fatest dns in Brazil)
    2) running behind cloduflare
    3) nginx + php 7.4.7 with opcache (centminmod of course)
    4) ssd vps hosted in USA (linode ny)
    5) no fear and knowledge about linux, tunning, testing, config, etc...


    My questions:
    1) Using cloudflare has a server, my vps can be run on USA/Euro or my server NEED to be hosted in Brazil? Latency from here to NY is around 140ms and around 200 to Paris/NL
    2) There any configuration on nginx to make it serve the pure htmls faster? Like memcache or something. (varnish is good idea?)
    3) How to propely track site loading time? Any good/trustable tools?
    4) I'm missing something?

    Thanks for ideas/help and excuses for my bad english, I'm trying my best to improve it.
     
  2. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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).
    Centmin Mod Nginx already has optimal static file configurations with exception of dynamically generated HTML content i.e. PHP generated HTML content

    For Wordpress sites read
    see WebPerf - PageSpeed - How to use webpagetest.org for page load speed testing

    Advanced Cloudflare optimisation of connection between Cloudflare and Centmin Mod Nginx server SSL - Cloudflare - Improving Cloudflare Connections To Origin Server - Use ECDSA SSL Certs
     
  3. Eduardo

    Eduardo Member

    38
    3
    8
    Feb 7, 2015
    Ratings:
    +5
    Local Time:
    3:50 PM
    1.7.9
    nice, alot of good info.

    My sites dont have logged in area, they change maybe one time per week or even a month. I dont use wordpress, they are just a bunch of html, css, js, jpg.
    Do you think is a good idea do make custom rule and tell to CF to cache everything? All sites are on free plan.

    I'm moving one by one to use custom ssl cert and change the config on CF to full (strict).

    Nothing else to do on server side? Keep centmin/php/nginx/mariadb updated and move the server to closest location of my visitors?

    And thanks for the centmin, I'm using it for more than 5 years, never disapointed me.
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,805
    12,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,858
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    if there's no login area and content doesn't change much and only updated by you, then yes

    Upgrade - Nginx - Insight Guide - How To Keep Informed Of Centmin Mod Related Updates

    Glad to hear. Maybe Ways To Support Centmin Mod ;)