Want to subscribe to topics you're interested in?
Become a Member

Wordpress wordpress speed, with centmin beta

Discussion in 'Blogs & CMS usage' started by ahmed, Mar 11, 2017.

  1. ahmed

    ahmed Member

    223
    17
    18
    Feb 21, 2017
    Ratings:
    +23
    Local Time:
    1:14 PM
    Hello Wordpress friends

    what is your setting after installing the beta?

    Mine:

    1-enable PHP 7
    2-enable Let's encrypt
    3-enable redis
    4-plugin :nginx helper with redis cach option
    5-redis object cache
    6-Key CDN

    what do u do in AMP?
    what do u choose during centmin setup to prevent mobile caching and why?


    Best
     
  2. RB1

    RB1 Active Member

    281
    72
    28
    Nov 11, 2016
    California
    Ratings:
    +119
    Local Time:
    3:14 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    For my Wordpress installations I use:
    Lets Encrypt
    Cloudflare for DNS/CDN
    PHP 7
    PageSpeed
     
    • Informative Informative x 1
  3. ahmed

    ahmed Member

    223
    17
    18
    Feb 21, 2017
    Ratings:
    +23
    Local Time:
    1:14 PM
  4. ahmed

    ahmed Member

    223
    17
    18
    Feb 21, 2017
    Ratings:
    +23
    Local Time:
    1:14 PM
    I remeber that pagespeed is not quite stable and it doesn't play well with CDN
     
  5. RB1

    RB1 Active Member

    281
    72
    28
    Nov 11, 2016
    California
    Ratings:
    +119
    Local Time:
    3:14 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    True...I'm still trying to figure out some issues with the rewritten images not serving via the Cloudflare CDN.
     
    • Like Like x 1
  6. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:14 PM
    Nginx 1.13.x
    MariaDB 5.5
    I use centmin.sh menu option 22 wordpress installer in centmin mod 123.09beta01 for my Wordpress7 site currently use Redis cache at nginx level - see site's blog posts for benchmark stats on 2GB DigitalOcean KVM VPS
    i choose to prevent mobile caching due to responsive themes looking different on mobile versus desktop
     
    • Like Like x 1
  7. ndha

    ndha Member

    55
    9
    8
    Sep 28, 2014
    Ratings:
    +23
    Local Time:
    6:14 PM
    Latest
    10
    @eva2000 any additional nginx config to prevent mobile caching with CMM??
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:14 PM
    Nginx 1.13.x
    MariaDB 5.5
    centmin.sh menu option 22 auto installed wordpress takes care of it when you answer yes to the prompt asking if you want to exclude mobile from caching
     
  9. ndha

    ndha Member

    55
    9
    8
    Sep 28, 2014
    Ratings:
    +23
    Local Time:
    6:14 PM
    Latest
    10
    @eva2000 IIRC i don't see that prompt at first time i use option 22 with CMM 123.08 a year ago :(
    what config do we use for already setup sites??
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:14 PM
    Nginx 1.13.x
    MariaDB 5.5
    Prompt only in 123.09beta01
     
  11. ndha

    ndha Member

    55
    9
    8
    Sep 28, 2014
    Ratings:
    +23
    Local Time:
    6:14 PM
    Latest
    10
    So, disable mobile cache can't be used with already setup site with 123.08, right??
    can i copy nginx config for it from 123.09??
    Fyi, i already upgrade to 123.09beta but my sites create from 123.08 before..
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:14 PM
    Nginx 1.13.x
    MariaDB 5.5
    you can manually add the exclusions if you know how

    which usually involve editing your keycdn cache enabler, wordpress super cache or redis cache include files

    i.e. where ${vhostname} is replaced with your domain.com

    for keycdn cache enabler edit and add to /usr/local/nginx/conf/wpincludes/${vhostname}/wpcacheenabler_${vhostname}.conf the following
    Code (Text):
        # exclude mobile devices from redis caching
        if ($cmwpcache_device = mobile) { set $cache_uri 'nullcache'; }
    

    for redis nginx level cache, edit and add to /usr/local/nginx/conf/wpincludes/${vhostname}/rediscache_${vhostname}.conf the following
    Code (Text):
    # exclude mobile devices from redis caching
    if ($redis_device = mobile) { set $skip_cache 1; }
    


    For redis nginx cache, then create a new file at /usr/local/nginx/conf/redisupstream.conf and add the code to it
    Code (Text):
    map $http_user_agent $redis_device {
        default                                     'desktop';
        ~*(iPad|iPhone|Android|IEMobile|Blackberry) 'mobile';
        "~*Firefox.*Mobile"                         'mobile';
        "~*ipod.*mobile"                            'mobile';
        "~*Opera\ Mini"                             'mobile';
        "~*Opera\ Mobile"                           'mobile';
        "~*Mobile"                                  'mobile';
        "~*Tablet"                                  'mobile';
        "~*Kindle"                                  'mobile';
        "~*Windows\ Phone"                          'mobile';
    }
    
    upstream redisbackend {
      zone upstream_redis 64k;
      server 127.0.0.1:6379 weight=1 max_fails=3 fail_timeout=30s;
      #server 127.0.0.1:6380 weight=1 max_fails=3 fail_timeout=30s;
      #server 127.0.0.1:6381 weight=1 max_fails=3 fail_timeout=30s;
      #server 127.0.0.1:6382 weight=1 max_fails=3 fail_timeout=30s;
      #server 127.0.0.1:6383 weight=1 max_fails=3 fail_timeout=30s;
      #server 127.0.0.1:6384 weight=1 max_fails=3 fail_timeout=30s;
    
      #server 127.0.0.1:6380 backup;
      keepalive 4096;
    }
    


    then edit /usr/local/nginx/conf/nginx.conf and add an include file for /usr/local/nginx/conf/redisupstream.conf after the existing /usr/local/nginx/conf/fastcgi_param_https_map.conf include file
    Code (Text):
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;
    include /usr/local/nginx/conf/redisupstream.conf;
    


    for keycdn cache enabler, create file at /usr/local/nginx/conf/wpcacheenabler_map.conf and add code to it
    Code (Text):
    map $http_user_agent $cmwpcache_device {
        default                                     'desktop';
        ~*(iPad|iPhone|Android|IEMobile|Blackberry) 'mobile';
        "~*Firefox.*Mobile"                         'mobile';
        "~*ipod.*mobile"                            'mobile';
        "~*Opera\ Mini"                             'mobile';
        "~*Opera\ Mobile"                           'mobile';
        "~*Mobile"                                  'mobile';
        "~*Tablet"                                  'mobile';
        "~*Kindle"                                  'mobile';
        "~*Windows\ Phone"                          'mobile';
    }
    


    then edit /usr/local/nginx/conf/nginx.conf and add an include file for /usr/local/nginx/conf/wpcacheenabler_map.conf after the existing /usr/local/nginx/conf/fastcgi_param_https_map.conf include file
    Code (Text):
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;
    include /usr/local/nginx/conf/wpcacheenabler_map.conf;
    

    then restart nginx and php-fpm
    Code (Text):
    nprestart
    


    If older wordpress auto installs had different path to include file you need to edit, post your nginx vhost contents here.

    When you create a new nginx vhost domain via centmin.sh menu option 2 or menu option 22 or via /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags)
     
    • Like Like x 2
  13. RootPass

    RootPass New Member

    11
    2
    3
    Mar 22, 2017
    Ratings:
    +3
    Local Time:
    1:14 PM
    CentMin
    CentMin
    hey guys
    just used the stable centminmod auto installer and WP Super cache giving me problems (need to click a lot of
    times to change the settings)
    any recommendation on the best cache options? many thanks ! :)
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:14 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah that's why Centmin Mod 123.09beta01 switched centmin.sh to allow KeyCDN Cache Enabler or Redis nginx level caching selections on top of WP Super Cache

    also why I highly recommend using Centmin Mod 123.09beta01 :)

    You can try manually switching to keycdn cacher enabler Wordpress - WP Cacher Enabler Plugin by KeyCDN folks.

    Latest details on what KeyCDN Cache Enabler is Free WordPress Cache Enabler Plugin
     
    • Like Like x 1
  15. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    7:14 PM
    Never understood why people want to disable mobile caching. Care to share your reason?
     
  16. elargento

    elargento Member

    293
    16
    18
    Jan 4, 2016
    Ratings:
    +39
    Local Time:
    8:14 AM
    10
    @eva2000 said
     
  17. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    7:14 PM
    Hmm, which responsive theme does that? Most latest or updated ones should have similar look whether cache is on or off?
     
  18. ahmed

    ahmed Member

    223
    17
    18
    Feb 21, 2017
    Ratings:
    +23
    Local Time:
    1:14 PM
    Actually I was asking too, I'm not expert
     
  19. eva2000

    eva2000 Administrator Staff Member

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    9:14 PM
    Nginx 1.13.x
    MariaDB 5.5
    Choice is let up to end users to decide for themselves as to whether to disable mobile caching :)
     
  20. ahmed

    ahmed Member

    223
    17
    18
    Feb 21, 2017
    Ratings:
    +23
    Local Time:
    1:14 PM
    ok, then how to edit this option after installing the wordpress/domain?