Learn about Centmin Mod LEMP Stack today
Register Now

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

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

  1. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:24 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 Query string cache policy · Issue #148 · keycdn/cache-enabler
    - And existing Cache Enabler 1.5.1 users who want to downgrade to 1.4.9 can follow instructions at Cache-Enabler Plugin - Cache is not created or served 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)
    Code (Text):
    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 >/dev/null 2>&1; echo $?)" -ne '0' ]; 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

    And
    Code (Text):
    domain=yourdomain.com
    chown -R nginx:nginx /home/nginx/domains/$domain/public

    - To remove the version lock on Cache Enabler so you can update from 1.4.9 to 1.5.1 you can run
    Code (Text):
    domain=yourdomain.com
    wp option delete bpu_update_blocked_plugins --allow-root --path=/home/nginx/domains/$domain/public


    Continue reading...

    123.09beta01 branch

     
    Last edited: Oct 15, 2020
  2. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:24 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Last edited: Oct 14, 2020