Welcome to Centmin Mod Community
Become a Member

Beta Branch update centmin.sh option 22 Cache Enabler 1.5.1+ support in 123.09beta01

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

  1. eva2000

    eva2000 Administrator Staff Member

    54,113
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,739
    Local Time:
    10:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    update centmin.sh option 22 Cache Enabler 1.5.1+ support in 123.09beta01

    - For fresh Wordpress installs with Cache Enabler 1.5.1+ and higher, new options have been added by the plugin so need to update centmin.sh menu option 22 to account for the option changes including the actual change of the option name used by Cache Enabler. Cache Enabler prior to 1.5.1 named it's option cache-enabler with hyphen but 1.5.1+ named it with underscore cache_enabler. So centmin.sh menu option 22 Cache Enabler setup and auto configuration needs to account for this as well as new option names.
    - This only impacts new centmin.sh menu option 22 runs. Existing Wordpress installs done via centmin.sh menu option 22 with Cache Enabler won't be affected as the initial install would of probably used Cache Enabler <1.5.1. To be sure, existing users can just log into wp-admin > Settings > Cache Enabler settings and hit Save changes and clear cache button once to ensure the most up to date version of settings is saved to database.

    Prior to 1.5.1 options looked like
    Code (Text):
    domain=yourdomain.com
    wp option get cache-enabler --format=json --path=/home/nginx/domains/$domain/public/ | jq
    {
      "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": "/^fbclid|utm_(source|medium|campaign|term|content|expid)|gclid|fb_(action_ids|action_types|source)|age-verified|ao_noptimize|usqp|cn-reloaded|_ga|_ke$/",
      "minify_html": 1
    }


    After 1.5.1+ options looked like
    Code (Text):
    domain=yourdomain.com
    wp option get cache_enabler --format=json --path=/home/nginx/domains/$domain/public/ | jq
    {
      "version": "1.5.1",
      "permalink_structure": "has_trailing_slash",
      "cache_expires": 1,
      "cache_expiry_time": 6,
      "clear_complete_cache_on_saved_post": 1,
      "clear_complete_cache_on_new_comment": 1,
      "clear_complete_cache_on_changed_plugin": 1,
      "compress_cache": 1,
      "convert_image_urls_to_webp": 0,
      "excluded_post_ids": "",
      "excluded_page_paths": "",
      "excluded_query_strings": "/^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$/",
      "excluded_cookies": "",
      "minify_html": 1,
      "minify_inline_css_js": 0
    }



    Continue reading...

    123.09beta01 branch
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,113
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,739
    Local Time:
    10:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    needed another update as the option for query strings went from included in cache (
    incl_parameters) to excluded from cache (excluded_query_strings) so needs to be unset not set

    so should be empty
    Code (Text):
    wp option get cache_enabler --format=json --allow-root | jq                                                              
    {
      "version": "1.5.1",
      "permalink_structure": "has_trailing_slash",
      "cache_expires": 1,
      "cache_expiry_time": 6,
      "clear_complete_cache_on_saved_post": 1,
      "clear_complete_cache_on_new_comment": 1,
      "clear_complete_cache_on_changed_plugin": 1,
      "compress_cache": 1,
      "convert_image_urls_to_webp": 0,
      "excluded_post_ids": "",
      "excluded_page_paths": "",
      "excluded_query_strings": "",
      "excluded_cookies": "",
      "minify_html": 1,
      "minify_inline_css_js": 0
    }
    

    So with Cache Enabler 1.5.1+ all query strings are cached by default and you set the exclude query string from cache settings via a regex for query strings you do not want cached i.e. regex

    looks like Wordpress search query strings need to be excluded now as they're incorrectly cached Query string cache policy · Issue #148 · keycdn/cache-enabler
    Code (Text):
    /^s=.+$/
    
     
    Last edited: Oct 14, 2020
  3. eva2000

    eva2000 Administrator Staff Member

    54,113
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,739
    Local Time:
    10:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Had to revert and downgrade and force Cache Enabler 1.4.9 for now due to changes in how Cache Enabler 1.5.1+ caches query strings so for new centmin.sh menu option 22 Cache Enabler installs you will get Cache Enabler 1.4.9 locked from updates until you unlock it to use old cache method. Details all outlined at Beta Branch - add Cache Enabler 1.4.9 legacy cache mode option in 123.09beta01