Welcome to Centmin Mod Community
Register Now

Cache-Enabler Plugin Cache is not created or served

Discussion in 'Blogs & CMS usage' started by Chuong Luong, Oct 14, 2020.

  1. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    Hi,

    I have been using Centminmod for my server for a few months. Last night, I just did an update for Cache Enabler and Centmin code.

    However, after these update, Cache Enabler did not create any cache. Before the update, according to documentation of Centmin, I can check whether I have cache serve by looking for the x-handler: wp and/or html timestamp. And I am sure that my site did serve the cache. As for now, no cache is created and served. I saw php running exhaustedly.

    Please help. I am a tech guy, so I don't know where to fix.

    Thanks.
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Before last nights Centmin Mod code update via cmupdate, how long ago prior did you do cmupdate ? Last 2 months there's been updates to Centmin Mod 123.09beta01's Wordpress Cache Enabler routines for centmin.sh menu option 22 Wordpress installer you can see from history of commits for specific inc/wpsetup.inc include file at centminmod/centminmod. These changes may or may not affect you depending on how long ago you updated centmin mod local code via cmupdate (as some of the changes have auto sync updates when you run centmin.sh menu after cmupdate while other changes need to be done manually Beta Branch - update centmin.sh menu option 22 wpsecure include file template in 123.09beta01)

    Cache Enabler plugin got some new updates too, so try wp-admin login to Cache Enabler settings and hit save and empty cache button once to make sure new features are in place.

    from SSH logged in session, run these commands to inspect response headers and to inspect the last few lines of HTML source code

    run each command twice - replace yourdomain.com with yours
    Code (Text):
    domain=https://yourdomain.com
    curl -I $domain
    curl -I $domain
    curl -s $domain | tail -3
    curl -s $domain | tail -3
    

    for posting code or output from commands to keep the formatting, you might want to use CODE tags for code How to use forum BBCODE code tags :)

    example from tail -3 HTML source code inspect of working Cache Enabler full HTML guest page cache
    Code (Text):
    curl -s https://mydomain.com/ | tail -3
    
    <!-- Cache Enabler by KeyCDN @ 14.10.2020 06:32:44 (https gzip) -->
    

    key part of the output is the comment line above
     
  3. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Also if you installed via centmin.sh menu option 22, wp-cli command line tool would have been installed so post output for

    listing your Wordpress plugins
    Code (Text):
    domain=yourdomain.com
    wp plugin list --allow-root --path=/home/nginx/domains/$domain/public
    

    and
    Code (Text):
    domain=yourdomain.com
    wp core version --extra --allow-root --path=/home/nginx/domains/$domain/public | column -t;
    
     
  4. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    The last time of cmupdate is probably 3rd Feb before my last night update, according to running the code from this Beta Branch - update centmin.sh menu option 22 wpsecure include file template in 123.09beta01.

    Code:
    ==========================================================================
    Generate Wordpress wpsecure include file:
    /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf-generated-141020-030200
    ==========================================================================
    generating updated Wordpress wpsecure include file at:
    /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf-generated-141020-030200
    generated: /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf-generated-141020-030200
    
    differences between existing and newly generated wpsecure_mydomain.com.conf file
    /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf
    versus
    /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf-generated-141020-030200
    --- /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf    2020-02-03 16:34:59.638207243 +0000
    +++ /usr/local/nginx/conf/wpincludes/mydomain.com/wpsecure_mydomain.com.conf-generated-141020-030200    2020-10-14 03:02:01.120383375 +0000
    
     
    Last edited: Oct 14, 2020
  5. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    Result from running

    Code:
    domain=https://mydomain.com
    curl -I $domain
    curl -I $domain
    curl -s $domain | tail -3
    curl -s $domain | tail -3
    Code:
    [03:19][root@vps tools]# curl -I $domain
    HTTP/1.1 200 OK
    Date: Wed, 14 Oct 2020 03:19:26 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=de04a4dc90996a03e2f8a418bd9684e5d1602645565; expires=Fri, 13-Nov-20 03:19:25 GMT; path=/; domain=.mydomain.com; HttpOnly; SameSite=Lax
    Vary: Accept-Encoding
    Link: <https://mydomain.com/wp-json/>; rel="https://api.w.org/"
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    CF-Cache-Status: DYNAMIC
    cf-request-id: 05c6b7b9bf000074bf72079200000001
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?lkg-colo=16&lkg-time=1602645566"}],"group":"cf-nel","max_age":604800}
    NEL: {"report_to":"cf-nel","max_age":604800}
    Server: cloudflare
    CF-RAY: 5e1e28a2c8e674bf-IAD
    
    [03:19][root@vps tools]# curl -I $domain
    HTTP/1.1 200 OK
    Date: Wed, 14 Oct 2020 03:19:49 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=da737901a7e2aebf03cb5aa896cbe46061602645588; expires=Fri, 13-Nov-20 03:19:48 GMT; path=/; domain=.mydomain.com; HttpOnly; SameSite=Lax
    Vary: Accept-Encoding
    Link: <https://mydomain.com/wp-json/>; rel="https://api.w.org/"
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    CF-Cache-Status: DYNAMIC
    cf-request-id: 05c6b812ae0000296a0ba15200000001
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?lkg-colo=16&lkg-time=1602645589"}],"group":"cf-nel","max_age":604800}
    NEL: {"report_to":"cf-nel","max_age":604800}
    Server: cloudflare
    CF-RAY: 5e1e29311ec1296a-IAD
    
    [03:19][root@vps tools]# curl -I $domain
    HTTP/1.1 200 OK
    Date: Wed, 14 Oct 2020 03:19:26 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=de04a4dc90996a03e2f8a418bd9684e5d1602645565; expires=Fri, 13-Nov-20 03:19:25 GMT; path=/; domain=.mydomain.com; HttpOnly; SameSite=Lax
    Vary: Accept-Encoding
    Link: <https://mydomain.com/wp-json/>; rel="https://api.w.org/"
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    CF-Cache-Status: DYNAMIC
    cf-request-id: 05c6b7b9bf000074bf72079200000001
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?lkg-colo=16&lkg-time=1602645566"}],"group":"cf-nel","max_age":604800}
    NEL: {"report_to":"cf-nel","max_age":604800}
    Server: cloudflare
    CF-RAY: 5e1e28a2c8e674bf-IAD
    
    [03:19][root@vps tools]# curl -I $domain
    HTTP/1.1 200 OK
    Date: Wed, 14 Oct 2020 03:19:49 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=da737901a7e2aebf03cb5aa896cbe46061602645588; expires=Fri, 13-Nov-20 03:19:48 GMT; path=/; domain=.mydomain.com; HttpOnly; SameSite=Lax
    Vary: Accept-Encoding
    Link: <https://mydomain.com/wp-json/>; rel="https://api.w.org/"
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    CF-Cache-Status: DYNAMIC
    cf-request-id: 05c6b812ae0000296a0ba15200000001
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?lkg-colo=16&lkg-time=1602645589"}],"group":"cf-nel","max_age":604800}
    NEL: {"report_to":"cf-nel","max_age":604800}
    Server: cloudflare
    CF-RAY: 5e1e29311ec1296a-IAD
    
    [03:19][root@vps tools]# curl -s $domain | tail -3
    </script>
    </body>
    </html>[03:20][root@vps tools]# curl -s $domain | tail -3
    </script>
    </body>
    </html>
    Result from running

    Code:
    domain=mydomain.com
    wp plugin list --allow-root --path=/home/nginx/domains/$domain/public
    wp core version --extra --allow-root --path=/home/nginx/domains/$domain/public | column -t;
    
    Code:
    +-------------------------------+--------+-----------+---------+
    | name                          | status | update    | version |
    +-------------------------------+--------+-----------+---------+
    | ad-inserter-pro               | active | none      | 2.6.15  |
    | advanced-database-cleaner-pro | active | none      | 3.1.6   |
    | cache-enabler                 | active | none      | 1.5.1   |
    | classic-editor                | active | none      | 1.6     |
    | coming-soon                   | active | none      | 5.1.3   |
    | disable-xml-rpc               | active | none      | 1.0.1   |
    | sucuri-scanner                | active | none      | 1.8.24  |
    | wordpress-seo                 | active | available | 14.5    |
    | advanced-cache.php            | dropin | none      |         |
    +-------------------------------+--------+-----------+---------+
    
    WordPress  version:   5.5.1
    
    Database   revision:  48748
    
    TinyMCE    version:   4.9100  (49100-20200624)
    
    Package    language:  en_US
    
    
     
    Last edited: Oct 14, 2020
  6. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    try now
     
  7. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    Thanks, I just updated my output.
     
  8. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    I see you're using Cloudflare. Make sure you do not set auto minity HTML on Cloudflare dashboard settings and only minify HTML via Cache Enabler
     
  9. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    Ah, no, I never use auto minify both on cloudflare and cache enabler.

    https://i.imgur.com/6t7Ibqa.png

    [​IMG]
     
  10. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    More info: the cache hasn't been generated, after the update.
     
    Last edited: Oct 14, 2020
  11. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    so quite a few updates in between that haven't been made

    post the contents of your cat /usr/local/nginx/conf/wpincludes/yourdomain.com/wpcacheenabler_yourdomain.com.conf include file

    replacing yourdomain.com with your actual domain
    Code (Text):
    cat /usr/local/nginx/conf/wpincludes/yourdomain.com/wpcacheenabler_yourdomain.com.conf


    the cache URL changed from Beta Branch - update centmin.sh menu 22 cache enabler cache config in 123.09beta01
    on first centmin.sh run after cmupdate, should get some output similar to Beta Branch - update centmin.sh menu 22 cache enabler cache config in 123.09beta01
     
  12. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    Output of cat /usr/local/nginx/conf/wpincludes/mydomain.com/wpcacheenabler_mydomain.com.conf

    Code:
    # Block nginx-help log from public viewing
        location ~* /wp-content/uploads/nginx-helper/ { deny all; }
    
        set $cache_uri $request_uri;
    
        # exclude mobile devices from redis caching
        #if ($cmwpcache_device = mobile) { set $cache_uri 'nullcache'; }
    
        # 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/|/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';
        }
    
        # 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|woocommerce_cart_hash|woocommerce_recently_viewed|wc_session_cookie_HASH|wp_woocommerce_session_|wptouch_switch_toggle") {
            set $cache_uri 'nullcache';
        }
    
        # bypass cache for woocommerce
        if ($arg_add-to-cart != "") { set $cache_uri 'nullcache'; }
    
        ## bypass cache for empty woocommerce carts
        #if ($cookie_woocommerce_items_in_cart != "0") {
        #  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}${scheme}-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}${scheme}-index-webp.html';
        }
    
    I also did this part when update:

    Code:
    - Existing cache enabler wordpress site users will first update 123.09beta01 local code via cmupdate command and then run once centmin.sh menu which will now auto detect all of your wordpress cache enabler enabled sites to see if their respective generated include files have the latest configuration update in /usr/local/nginx/conf/wpincludes/${vhostname}/wpcacheenabler_${vhostname}.conf where ${vhostname} is your wordpress domain name
    I notice these 2:

    Code:
    #########################################################################
    Starting Automatic Wordpress Cache Enabler Advanced Cache Config Update
    https://community.centminmod.com/threads/20256/
    
    ce_count=1 updated: mydomain.com
    
    Completed Automatic Wordpress Cache Enabler Advanced Cache Config Update
    saved log at /root/centminlogs/centminmod_123.09beta01.b599_131020-170524_cache_enabler_scheme_fix.log
    #########################################################################
    Code:
    Cache entry deserialization failed, entry ignored
    Cache entry deserialization failed, entry ignored
    Is it considered updated successfully?

    I also notice this happens when comparing 2 of my site:

    Site 1: is the newly update cmupdate & cache enabler 1.5.1
    - No cache-enabler folder in wp-content, no cache-enabler-advcache-domain.json

    Site 2: not updated to new cmupdate & cache enabler is 1.4.9
    - Have cache-enabler folder in wp-content and cache-enabler-advcache-domain.json

    Is it the problem?
     
  13. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    is mydomain.com the domain with cache enabler issues or one that is working?

    could be related to 1.5.1 changes but your include file /usr/local/nginx/conf/wpincludes/mydomain.com/wpcacheenabler_mydomain.com.conf has the updated format for
    Code (Text):
       # default html file
       set $cache_enabler_uri '${custom_subdir}/wp-content/cache/cache-enabler/${http_host}${cache_uri}${scheme}-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}${scheme}-index-webp.html';
       }
    

    so should work.

    But it could be issue if you tried deactivating/activating cache enabler from wp-admin. Try doing it via WP-CLI command line

    Code (Text):
    domain=yourdomain.com
    wp plugin deactivate cache-enabler --allow-root --path=/home/nginx/domains/$domain/public
    wp plugin activate cache-enabler --allow-root --path=/home/nginx/domains/$domain/public
    

    then try
    Code (Text):
    domain=https://yourdomain.com
    curl -I $domain
    curl -I $domain
    curl -s $domain | tail -3
    curl -s $domain | tail -3
    
     
  14. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    Code:
    ce_count=1 updated: mydomain.com
    Is the one with the cache enabler issue.

    I did the wp-cli de/reactivate, output is still the same. Nothing changes.
     
  15. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    make sure all files/directories are owned by nginx user/group too
    Code (Text):
    domain=yourdomain.com
    chown -R nginx:nginx /home/nginx/domains/$domain/public
    
     
  16. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    yes i did, still nothing changes
     
  17. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
  18. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
  19. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:41 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    I have working 1.5.1 caching but might look at ways to downgrade and stick with cache enabler 1.5.0 and not 1.5.1 due to other bugs too with change to cache all query strings also breaks native Wordpress search Query string cache policy · Issue #148 · keycdn/cache-enabler
     
  20. Chuong Luong

    Chuong Luong New Member

    17
    0
    1
    Aug 8, 2019
    Ratings:
    +1
    Local Time:
    6:41 PM
    Is there anyway to downgrade both centmin and cache-enabler to my previous version? :( I just need working cache again.