Welcome to Centmin Mod Community
Become a Member

Beta Branch update inc/wpsetup.inc for easydigitaldownload wordpress plugin suppo…

Discussion in 'Centmin Mod Github Commits' started by eva2000, Aug 19, 2016.

  1. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:42 AM
    Nginx 1.13.x
    MariaDB 5.5
  2. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:42 AM
    Nginx 1.13.x
    MariaDB 5.5
    Just did a test Centmin Mod 123.09beta01 version of centmin.sh menu option 22 wordpress auto install for dummy domain = domain1.com to check the 3 variant include files for wp super cache, key cdn cache enabler and redis cache

    include files are placed in /usr/local/nginx/conf/wpincludes/domain1.com/
    Code (Text):
    ls -lah /usr/local/nginx/conf/wpincludes/domain1.com/
    total 24K
    drwxr-x--- 2 root root  146 Aug 18 15:13 .
    drwxr-x--- 3 root root   24 Aug 18 15:13 ..
    -rw-r--r-- 1 root root 1.2K Aug 18 15:13 rediscache_domain1.com.conf
    -rw-r--r-- 1 root root 1.4K Aug 18 15:13 wpcacheenabler_domain1.com.conf
    -rw-r--r-- 1 root root 8.4K Aug 18 15:13 wpsecure_domain1.com.conf
    -rw-r--r-- 1 root root  588 Aug 18 15:13 wpsupercache_domain1.com.conf

    updated /usr/local/nginx/conf/wpincludes/domain1.com/rediscache_domain1.com.conf
    Code (Text):
    set $skip_cache 0;
    
    # POST requests and urls with a query string should always go to PHP
    if ($request_method = POST) {
      set $skip_cache 1;
    }
    
    if ($query_string != "") {
      set $skip_cache 1;
    }
    
    # Don't cache uris containing the following segments
    if ($request_uri ~* "\?add-to-cart=|/cart/|/my-account/|/checkout/|/shop/checkout/|/store/checkout/|/customer-dashboard/|/addons/|/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
      set $skip_cache 1;
    }
    
    # Don't use the cache for logged in users or recent commenters
    if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|edd_items_in_cart|woocommerce_items_in_cart") {
      set $skip_cache 1;
    }
    
    location /redis-fetch {
      internal  ;
      set  $redis_key $args;
      redis_pass  redisbackend;
      redis_connect_timeout 60000;
      redis_read_timeout 60000;
      redis_send_timeout 60000;
    }
    
    location /redis-store {
      internal  ;
      set_unescape_uri $key $arg_key ;
      redis2_query set $key $echo_request_body;
      redis2_query expire $key 6h;
      redis2_pass  redisbackend;
      redis2_connect_timeout 60s;
      redis2_read_timeout 60s;
      redis2_send_timeout 60s;
    }
    

    Updated keycdn cache enabler include /usr/local/nginx/conf/wpincludes/domain1.com/wpcacheenabler_domain1.com.conf
    Code (Text):
        set $cache_uri $request_uri;
    
        # bypass cache if POST requests or URLs with a query string
        if ($request_method = POST) {
            set $cache_uri 'nullcache';
        }
        if ($query_string != "") {
            set $cache_uri 'nullcache';
        }
    
        # bypass cache if URLs containing the following strings
        if ($request_uri ~* "(\?add-to-cart=|/cart/|/my-account/|/checkout/|/shop/checkout/|/store/checkout/|/customer-dashboard/|/addons/|/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
            set $cache_uri 'nullcache';
        }
    
        # bypass cache if the cookies containing the following strings
        if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|edd_items_in_cart|woocommerce_items_in_cart") {
            set $cache_uri 'nullcache';
        }
    
        # custom sub directory e.g. /blog
        set $custom_subdir '';
    
        # default html file
        set $cache_enabler_uri '${custom_subdir}/wp-content/cache/cache-enabler/${http_host}${cache_uri}index.html';
    
        # webp html file
        if ($http_accept ~* "image/webp") {
            set $cache_enabler_uri '${custom_subdir}/wp-content/cache/cache-enabler/${http_host}${cache_uri}index-webp.html';
        }
    

    updated wp super cache /usr/local/nginx/conf/wpincludes/domain1.com/wpsupercache_domain1.com.conf
    Code (Text):
    set $cache_uri $request_uri;
    
    if ($request_method = POST) { set $cache_uri 'null cache'; }
    
    if ($query_string != "") { set $cache_uri 'null cache'; }
    
    if ($request_uri ~* "/(\?add-to-cart=|cart/|my-account/|checkout/|shop/checkout/|store/checkout/|customer-dashboard/|addons/|wp-admin/.*|xmlrpc\.php|wp-.*\.php|index\.php|feed/|sitemap(_index)?\.xml|[a-z0-9_-]+-sitemap([0-9]+)?\.xml)") { set $cache_uri 'null cache'; }
    
    if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in|edd_items_in_cart|woocommerce_items_in_cart") { set $cache_uri 'null cache'; }
    
     
    Last edited: Aug 19, 2016
  3. Saumya Majumder

    Saumya Majumder Member

    60
    3
    8
    Mar 16, 2016
    Ratings:
    +12
    Local Time:
    7:12 AM
    1.9.12
    10.0.24
    fastcgi config is missing above
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:42 AM
    Nginx 1.13.x
    MariaDB 5.5
    centmin.sh menu option 22 doesn't setup fastcgi_cache that's why it's missing
     
  5. Saumya Majumder

    Saumya Majumder Member

    60
    3
    8
    Mar 16, 2016
    Ratings:
    +12
    Local Time:
    7:12 AM
    1.9.12
    10.0.24
    Yah it's ok. What I tried to mean is in the fastcgi setup, update it too. That's all. :)
     
    • Agree Agree x 1
  6. eva2000

    eva2000 Administrator Staff Member

    29,031
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,782
    Local Time:
    11:42 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1