Learn about Centmin Mod LEMP Stack today
Become a Member

Beta Branch update centmin.sh menu option 22 wordpress routine in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jun 5, 2019.

  1. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:03 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    update centmin.sh menu option 22 wordpress routine in 123.09beta01

    Add /wp-json requests exclusion from respective full page caching for keycdn cache enabler, redis nginx level cache and wp super cache methods for their respective $request_uri exclusion lines in their respective auto created include files which are as follows where ${vhostname} is your domain name for wordpress install. This will skip caching /wp-json requests for new centmin.sh menu option 22 wordpress installs which have this updated code. Existing wordpress installs will need to manually make the relevant changes below as to not overwrite any changes in existing wordpress custom installs which may break the wordpress sites.

    - for keycdn cache enabler at /usr/local/nginx/conf/wpincludes/${vhostname}/wpcacheenabler_${vhostname}.conf relevant updated line now looks like
    Code (Text):
        if ($request_uri ~* "(\?add-to-cart=|/cart/|/my-account/|/checkout/|/shop/checkout/|/wp-json/|/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';
        }
    


    - for redis at /usr/local/nginx/conf/wpincludes/${vhostname}/rediscache_${vhostname}.conf relevant updated line now looks like
    Code (Text):
    if ($request_uri ~* "\?add-to-cart=|/cart/|/my-account/|/checkout/|/shop/checkout/|/wp-json/|/store/checkout/|/customer-dashboard/|/addons/|/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
      set $skip_cache 1;
    }
    


    - for wp super cache at /usr/local/nginx/conf/wpincludes/${vhostname}/wpsupercache_${vhostname}.conf relevant updated line now looks like
    Code (Text):
    if ($request_uri ~* "/(\?add-to-cart=|cart/|my-account/|checkout/|shop/checkout/|store/checkout/|wp-json/|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'; }
    


    Continue reading...


    123.09beta01 branch