Want more timely Centmin Mod News Updates?
Become a Member

Master Branch add Cache Enabler 1.4.9 legacy cache mode option in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Oct 22, 2020.

  1. eva2000

    eva2000 Administrator Staff Member

    45,728
    10,382
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,112
    Local Time:
    10:17 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    add Cache Enabler 1.4.9 legacy cache mode option in 123.09beta01

    - Add a new centmin.sh variable which defaults to CACHE_ENABLER_LEGACY_CACHE='y' which will install Cache Enabler 1.4.9 and lock to that version via block-specific-plugin-updates wordpress plugin to prevent update to Cache Enabler 1.5.1 which changes query string specifying from cache inclusion to cache exclusion method. 1.4.9 excluded all query strings unless you specified query strings to include in cache. 1.5.1 include all query strings in cache by default breaking some Wordpress plugins and requires users to specify query strings to exclude from cache. This updated option is for fresh new Cache Enabler installs via centmin.sh menu option 22 when CACHE_ENABLER_LEGACY_CACHE='y' is set (by default), or you can set CACHE_ENABLER_LEGACY_CACHE='n' in persistent config file /etc/centminmod/custom_config.inc to override this so centmin.sh menu option 22 installs Cache Enabler 1.5.1+ by default.
    - This is a temp measure until 1.5.1+ issues are sorted. You can read the discussion on 1.5.1 caches at https://github.com/keycdn/cache-enabler/issues/148
    - And existing Cache Enabler 1.5.1 users who want to downgrade to 1.4.9 can follow instructions at https://community.centminmod.com/threads/cache-is-not-created-or-served.20542/page-2#post-86659 or below

    replace yourdomain.com in domain variable with your Wordpress domain and run the commands in SSH until the last nprestart (nginx + PHP-FPM restarts)

    domain=yourdomain.com
    wp plugin deactivate cache-enabler --allow-root --path=/home/nginx/domains/$domain/public
    wp plugin uninstall cache-enabler --allow-root --path=/home/nginx/domains/$domain/public
    wp plugin install cache-enabler --version=1.4.9 --force --activate --allow-root --path=/home/nginx/domains/$domain/public
    nprestart

    wp option update cache-enabler '{"expires":6,"clear_on_upgrade":1,"new_post":1,"new_comment":1,"update_product_stock":0,"webp":0,"compress":1,"excl_ids":"","excl_paths":"","excl_cookies":"","incl_parameters":"","minify_html":0}' --format=json --allow-root --path=/home/nginx/domains/$domain/public

    wp option patch update cache-enabler incl_parameters '/^fbclid|ref|mc_(cid|eid)|utm_(source|medium|campaign|term|content|expid)|gclid|fb_(action_ids|action_types|source)|age-verified|ao_noptimize|usqp|cn-reloaded|_ga|_ke$/' --allow-root --path=/home/nginx/domains/$domain/public

    wp option pluck cache-enabler incl_parameters --format=json --allow-root --path=/home/nginx/domains/$domain/public

    wp option get cache-enabler --format=json --path=/home/nginx/domains/$domain/public/ | jq

    wp plugin install block-specific-plugin-updates --activate --allow-root --path=/home/nginx/domains/$domain/public

    if [ $(wp option get bpu_update_blocked_plugins --allow-root --path=/home/nginx/domains/$domain/public
    ) ]; then wp option update bpu_update_blocked_plugins cache-enabler/cache-enabler.php --allow-root --path=/home/nginx/domains/$domain/public; else wp option add bpu_update_blocked_plugins cache-enabler/cache-enabler.php --allow-root --path=/home/nginx/domains/$domain/public; fi

    nprestart

    - To remove the version lock on Cache Enabler so you can update from 1.4.9 to 1.5.1 you can run

    domain=yourdomain.com
    wp option delete bpu_update_blocked_plugins --allow-root --path=/home/nginx/domains/$domain/public

    Continue reading...

    Centmin Mod Github Master branch

    Master branch is where most recent commits are made as at May 24, 2015.