• I have WP Super Cache installed as well as Woocommerce and a few other plugins. I have gone through every tutorial, post and thread about installing and everything that is needed is there. But for some reason the plugin does not work. I get this error when testing:

    The pages do not match! Timestamps differ or were not found!

    Here is some of the debug script:

    16:01:24 /2014/01/the-springy-rig-by-leon-bartropp/ wp_cache_check_mobile:
    16:01:24 /2014/01/the-springy-rig-by-leon-bartropp/ supercache dir: /home/public_html/my_site/wp-content/cache/supercache/mysite.co.uk/2014/01/the-springy-rig-by-leon-bartropp/
    16:01:24 /2014/01/the-springy-rig-by-leon-bartropp/ No Super Cache file found for current URL: /home/public_html/mysite/wp-content/cache/supercache/mysite.co.uk/2014/01/the-springy-rig-by-leon-bartropp/index.html
    16:01:24 /2014/01/the-springy-rig-by-leon-bartropp/ In WP Cache Phase 2
    16:01:24 /2014/01/the-springy-rig-by-leon-bartropp/ Setting up WordPress actions
    16:01:24 /2014/01/the-springy-rig-by-leon-bartropp/ Created output buffer
    16:01:26 /2014/01/the-springy-rig-by-leon-bartropp/ DONOTCACHEPAGE defined. Caching disabled.
    16:01:26 /feed/ wp_cache_check_mobile:
    16:01:26 /feed/ supercache dir: /home/public_html/test_site/wp-content/cache/supercache/mysite.co.uk/feed/
    16:01:26 /feed/ No Super Cache file found for current URL: /home/public_html/test_site/wp-content/cache/supercache/mysite.co.uk/feed/index.html
    16:01:27 /feed/ In WP Cache Phase 2
    16:01:27 /feed/ Setting up WordPress actions
    16:01:27 /feed/ Created output buffer
    16:01:28 /feed/ DONOTCACHEPAGE defined. Caching disabled.

    I don’t know for sure but it seems as if the caching is being stopped by the DONOTCACHEPAGE defined, which is set by Woocommerce (I think). I have tried to override this by define('DONOTCAHEPAGE', false); in my wp-config and in my themes header but this has not worked. Does anybody have any experience with this situation? I would really appreciate some help.

    https://wordpress.org/plugins/wp-super-cache/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Howdy!

    Could you please try temporarily deactivating WooCommerce, and then check to see if the issue persists?

    You can also try to deactivate all plugins on your site, and see if that resolves the issue. If it does, then activate them one at a time to determine which is causing the conflict.

    If that doesn’t help, please rule out a theme conflict by temporarily changing your site’s theme to a default theme (such as Twenty Twelve) and trying again.

    Let me know how that works for you, and we’ll go from there!

    Thread Starter G-Olly

    (@g-olly)

    Hi Ryan, thanks for responding, you’re right I should have done these tests before posting! I have now gone through and deactivated the plugins one by one until nothing was running apart from WP Super Cache, still did not work. So I then changed themes to default twenty 13 and then 14 and the site still did not cache, as such it seems that the problem lies with my WP Super Cache set-up and not with anything else.

    I will now go back and do the same plus generate the debug script at the same time and see if the issue becomes clear (probably not to me but maybe to one of you clever people).

    Thread Starter G-Olly

    (@g-olly)

    Ok I have again deactivated all plugins except WP Super Cache and activated the twenty 13 theme.

    Here is the results:

    Debug page

    09:38:47 /wp-admin/admin-ajax.php wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:38:47 /wp-admin/admin-ajax.php In WP Cache Phase 2
    09:38:47 /wp-admin/admin-ajax.php Setting up WordPress actions
    09:38:47 /wp-admin/admin-ajax.php Not caching wp-admin requests.
    09:39:05 / wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:05 / wp_cache_check_mobile:
    09:39:05 / supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/
    09:39:05 / No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/index.html
    09:39:05 / wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:05 / In WP Cache Phase 2
    09:39:05 / Setting up WordPress actions
    09:39:05 / Created output buffer
    09:39:05 / wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:05 / DONOTCACHEPAGE defined. Caching disabled.
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions wp_cache_check_mobile:
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/index.html
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions In WP Cache Phase 2
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Setting up WordPress actions
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Supercache caching disabled. Only using wp-cache. Non empty GET request. Array
    (
        [wysija-page] => 1
        [controller] => subscribers
        [action] => wysija_outter
        [wysija_form] => 1
        [external_site] => 1
        [wysijap] => subscriptions
    )
    
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Created output buffer
    09:39:06 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions DONOTCACHEPAGE defined. Caching disabled.
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions wp_cache_check_mobile:
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/index.html
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions In WP Cache Phase 2
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Setting up WordPress actions
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Supercache caching disabled. Only using wp-cache. Non empty GET request. Array
    (
        [wysija-page] => 1
        [controller] => subscribers
        [action] => wysija_outter
        [wysija_form] => 1
        [external_site] => 1
        [wysijap] => subscriptions
    )
    
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Created output buffer
    09:39:07 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions DONOTCACHEPAGE defined. Caching disabled.
    09:39:10 / wp_cache_check_mobile:
    09:39:10 / supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/
    09:39:10 / No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/index.html
    09:39:10 / In WP Cache Phase 2
    09:39:10 / Setting up WordPress actions
    09:39:10 / Created output buffer
    09:39:11 / DONOTCACHEPAGE defined. Caching disabled.
    09:39:12 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions wp_cache_check_mobile:
    09:39:12 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/
    09:39:12 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/index.html
    09:39:13 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions In WP Cache Phase 2
    09:39:13 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Setting up WordPress actions
    09:39:13 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Supercache caching disabled. Only using wp-cache. Non empty GET request. Array
    (
        [wysija-page] => 1
        [controller] => subscribers
        [action] => wysija_outter
        [wysija_form] => 1
        [external_site] => 1
        [wysijap] => subscriptions
    )
    
    09:39:13 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions Created output buffer
    09:39:13 /?wysija-page=1&controller=subscribers&action=wysija_outter&wysija_form=1&external_site=1&wysijap=subscriptions DONOTCACHEPAGE defined. Caching disabled.
    09:39:15 /news/ wp_cache_check_mobile:
    09:39:15 /news/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/news/
    09:39:15 /news/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/news/index.html
    09:39:16 /news/ In WP Cache Phase 2
    09:39:16 /news/ Setting up WordPress actions
    09:39:16 /news/ Created output buffer
    09:39:16 /news/ DONOTCACHEPAGE defined. Caching disabled.
    09:39:18 /product/pop-up-foam/coloured-pop-up-foam-copy/ No wp-cache file served as user agent rejected.
    09:39:18 /product/pop-up-foam/coloured-pop-up-foam-copy/ In WP Cache Phase 2
    09:39:18 /product/pop-up-foam/coloured-pop-up-foam-copy/ Setting up WordPress actions
    09:39:18 /product/pop-up-foam/coloured-pop-up-foam-copy/ USER AGENT (Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)) rejected. Not Caching
    09:39:31 /teams/ wp_cache_check_mobile:
    09:39:31 /teams/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/teams/
    09:39:31 /teams/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/teams/index.html
    09:39:31 /teams/ In WP Cache Phase 2
    09:39:31 /teams/ Setting up WordPress actions
    09:39:31 /teams/ Created output buffer
    09:39:32 /teams/ DONOTCACHEPAGE defined. Caching disabled.
    09:39:32 /media/videos/carp-videos/ wp_cache_check_mobile:
    09:39:32 /media/videos/carp-videos/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/media/videos/carp-videos/
    09:39:32 /media/videos/carp-videos/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/media/videos/carp-videos/index.html
    09:39:32 /media/videos/carp-videos/ In WP Cache Phase 2
    09:39:32 /media/videos/carp-videos/ Setting up WordPress actions
    09:39:32 /media/videos/carp-videos/ Created output buffer
    09:39:32 /media/videos/carp-videos/ DONOTCACHEPAGE defined. Caching disabled.
    09:39:39 /contact/ wp_cache_check_mobile:
    09:39:39 /contact/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/contact/
    09:39:39 /contact/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/contact/index.html
    09:39:39 /contact/ In WP Cache Phase 2
    09:39:39 /contact/ Setting up WordPress actions
    09:39:39 /contact/ Created output buffer
    09:39:39 /contact/ DONOTCACHEPAGE defined. Caching disabled.
    09:39:39 /products/ wp_cache_check_mobile:
    09:39:39 /products/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/products/
    09:39:39 /products/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/products/index.html
    09:39:39 /products/ In WP Cache Phase 2
    09:39:39 /products/ Setting up WordPress actions
    09:39:39 /products/ Created output buffer
    09:39:40 /products/ DONOTCACHEPAGE defined. Caching disabled.
    09:39:49 /wp-admin/admin-ajax.php wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3/ Cookie detected: wordpress_logged_in_6c79aca1712690ae232b744e4c1b4de3
    09:39:49 /wp-admin/admin-ajax.php In WP Cache Phase 2
    09:39:49 /wp-admin/admin-ajax.php Setting up WordPress actions
    09:39:49 /wp-admin/admin-ajax.php Not caching wp-admin requests.
    09:39:58 /stockists/ wp_cache_check_mobile:
    09:39:58 /stockists/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/stockists/
    09:39:58 /stockists/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/stockists/index.html
    09:39:59 /stockists/ In WP Cache Phase 2
    09:39:59 /stockists/ Setting up WordPress actions
    09:39:59 /stockists/ Created output buffer
    09:39:59 /stockists/ DONOTCACHEPAGE defined. Caching disabled.
    09:39:59 /contact/ wp_cache_check_mobile:
    09:39:59 /contact/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/contact/
    09:39:59 /contact/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/contact/index.html
    09:39:59 /contact/ In WP Cache Phase 2
    09:39:59 /contact/ Setting up WordPress actions
    09:39:59 /contact/ Created output buffer
    09:40:00 /contact/ DONOTCACHEPAGE defined. Caching disabled.
    09:40:03 /teams/ wp_cache_check_mobile:
    09:40:03 /teams/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/teams/
    09:40:03 /teams/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/teams/index.html
    09:40:03 /teams/ In WP Cache Phase 2
    09:40:03 /teams/ Setting up WordPress actions
    09:40:03 /teams/ Created output buffer
    09:40:03 /teams/ DONOTCACHEPAGE defined. Caching disabled.
    09:40:03 /media/videos/carp-videos/ wp_cache_check_mobile:
    09:40:03 /media/videos/carp-videos/ supercache dir: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/media/videos/carp-videos/
    09:40:03 /media/videos/carp-videos/ No Super Cache file found for current URL: /home/me/public_html/my_site/wp-content/cache/supercache/mysite.com/media/videos/carp-videos/index.html
    09:40:03 /media/videos/carp-videos/ In WP Cache Phase 2
    09:40:03 /media/videos/carp-videos/ Setting up WordPress actions
    09:40:03 /media/videos/carp-videos/ Created output buffer
    09:40:03 /media/videos/carp-videos/ DONOTCACHEPAGE defined. Caching disabled.

    Here is the default .htaccess that was enabled:

    #   BULLETPROOF DEFAULT .HTACCESS      
    
    # If you edit the line of code above you will see error messages on the BPS Security Status page
    # WARNING!!! THE default.htaccess FILE DOES NOT PROTECT YOUR WEBSITE AGAINST HACKERS
    # This is a standard generic htaccess file that does NOT provide any website security
    # The DEFAULT .HTACCESS file should be used for testing and troubleshooting purposes only
    
    php_value suhosin.post.max_vars 5000
    php_value suhosin.request.max_vars 5000
    
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
    RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
    RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
    RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).* [NC]
    RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html" [L]
    </IfModule>
    
    # END WPSuperCache
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    I can’t upload the images that I have of the WP Super Cache settings.
    So I will detail it here (lines are the ones ticked):

    Easy
    
    Caching On (Recommended)
    
    Advanced
    
    Caching:	 	Cache hits to this website for quick access. (Recommended)
    
     			Use mod_rewrite to serve cache files. (Recommended)
    
    Miscellaneous	 	Compress pages so they’re served more quickly to visitors. (Recommended)
    			Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated. (Recommended)
    
    Advanced		Mobile device support. (External plugin or theme required. See the FAQ for further details.)
    			Clear all cache files when a post or page is published or updated.
     			Extra homepage checks. (Very occasionally stops homepage caching) (Recommended)

    Does this mean anything to anyone? Seems to me that the constant DONOTCACHPAGE is still making the cache not run.

    Thread Starter G-Olly

    (@g-olly)

    Oh and this is in my wp-config:

    define('WP_CACHE', true); //Added by WP-Cache Manager
    define( 'WPCACHEHOME', '/home/me/public_html/my_site/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager
    define('DONOTCACHEPAGE', false); //added by me

    I also have these files in my wp-content:

    advanced-cache.php
    wp-cache-config.php

    wp-content/cache:

    .htaccess
    meta folder and supercache folder

    Thank you for all of the info! Now, let’s see if we can get to the bottom of this πŸ™‚

    First, can you try removing define('DONOTCACHEPAGE', false); from your wp-config.php file? Then, see if the issue persists.

    If you can ssh to your server, you can use grep to find out where DONOTCACHEPAGE is defined. It might be hidden away somewhere (maybe if you were testing something in the past?).

    You could also try adding checks for that constant in wp-settings.php – you can use error_log to flag it in a log file if it’s defined. Start at the top and move the check down the file and you might find that some file defines it and when it’s included the error_log will run.

    If the issue persists, you can try completely reinstalling WP Super Cache. Please follow the instructions in the FAQ to do so.

    If you continue to have trouble after that, could you please let me know how you are testing caching on your site? It would also be helpful if you could provide me with a link to the site in question, as well as a full list of plugins that you have installed.

    Thanks again!

    Thread Starter G-Olly

    (@g-olly)

    Hi Ryan, thanks for getting back to me once again.

    I deleted the define(‘DONOTCACHEPAGE’, false); from my wp-config.php unfortunately that did not rectify the issue. I installed ‘Debug This’ as I thought it might give me more of a complete indication (plus it’s easier)! So with this installed I can see that on all of my pages/posts:

    constants - Defined Constants:
    
    [DONOTCACHEPAGE] => true
    [DONOTCACHEOBJECT] => true
    [DONOTCACHEDB] => true

    I have found where this is defined by Woocommerce, in this file – class-wc-cache-helper.php

    <?php
    if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    
    /**
    * WC_Cache_Helper class.
    *
    * @class WC_Cache_Helper
    * @version	 2.0.6
    * @package	 WooCommerce/Classes
    * @category	Class
    * @author WooThemes
    */
    class WC_Cache_Helper {
    
    /**
    * __construct function.
    *
    * @access public
    * @return void
    */
    public function __construct() {
    add_action( 'before_woocommerce_init', array( $this, 'init' ) );
    add_action( 'admin_notices', array( $this, 'notices' ) );
    }
    
    /**
    * Prevent caching on dynamic pages.
    *
    * @access public
    * @return void
    */
    public function init() {
    if ( false === ( $wc_page_uris = get_transient( 'woocommerce_cache_excluded_uris' ) ) ) {
    
    if ( wc_get_page_id( 'cart' ) < 1 || wc_get_page_id( 'checkout' ) < 1 || wc_get_page_id( 'myaccount' ) < 1 )
    return;
    
    $wc_page_uris = array();
    
    // Exclude querystring when using page ID
    $wc_page_uris[] = 'p=' . wc_get_page_id( 'cart' );
    $wc_page_uris[] = 'p=' . wc_get_page_id( 'checkout' );
    $wc_page_uris[] = 'p=' . wc_get_page_id( 'myaccount' );
    
    // Exclude permalinks
    $cart_page = get_post( wc_get_page_id( 'cart' ) );
    $checkout_page = get_post( wc_get_page_id( 'checkout' ) );
    $account_page = get_post( wc_get_page_id( 'myaccount' ) );
    
    if ( ! is_null( $cart_page ) )
    $wc_page_uris[] = '/' . $cart_page->post_name;
    if ( ! is_null( $checkout_page ) )
    $wc_page_uris[] = '/' . $checkout_page->post_name;
    if ( ! is_null( $account_page ) )
    $wc_page_uris[] = '/' . $account_page->post_name;
    
    set_transient( 'woocommerce_cache_excluded_uris', $wc_page_uris );
    }
    
    if ( is_array( $wc_page_uris ) )
    foreach( $wc_page_uris as $uri )
    if ( strstr( $_SERVER['REQUEST_URI'], $uri ) ) {
    $this->nocache();
    break;
    }
    }
    
    /**
    * Set nocache constants and headers.
    *
    * @access private
    * @return void
    */
    private function nocache() {
    if ( ! defined( 'DONOTCACHEPAGE' ) )
    define( "DONOTCACHEPAGE", "true" );
    
    if ( ! defined( 'DONOTCACHEOBJECT' ) )
    define( "DONOTCACHEOBJECT", "true" );
    
    if ( ! defined( 'DONOTCACHEDB' ) )
    define( "DONOTCACHEDB", "true" );
    
    nocache_headers();
    }
    
    /**
    * notices function.
    *
    * @access public
    * @return void
    */
    public function notices() {
    if ( ! function_exists( 'w3tc_pgcache_flush' ) || ! function_exists( 'w3_instance' ) )
    return;
    
    $config = w3_instance('W3_Config');
    $enabled = $config->get_integer( 'dbcache.enabled' );
    $settings = $config->get_array( 'dbcache.reject.sql' );
    
    if ( $enabled && ! in_array( '_wc_session_', $settings ) ) {
    ?>
    <div class="error">
    <p><?php printf( __( 'In order for database caching to work with WooCommerce you must add _wc_session_ to the "Ignored Query Strings" option in W3 Total Cache settings here.', 'woocommerce' ), admin_url( 'admin.php?page=w3tc_dbcache' ) ); ?></p>
    </div>
    <?php
    }
    }
    }
    
    new WC_Cache_Helper();

    Seems strange that this constant is still defined even when WC is deactivated. To make sure I will now deactivate all again and see if this constant is still defined.

    Thread Starter G-Olly

    (@g-olly)

    So after deactivating Woocommerce I have discovered that the define(“DONOTCACHEPAGE”, “true”); constant is no longer defined.

    After switching to PHP mode I now have cached pages being served!
    Unfortunately I have had to reactivate Woo as it is the basis for displaying the content on my site. This means that the DONOTCACHEPAGE constant is again getting defined causing the cache to not work. As I do not use WC to sell anything I should be able to override these constants with no effect to the site.

    I will try once again adding the define(‘DONOTCACHEPAGE’, false); constant to the header and the wp-config which should hopefully mean they allow caching to take place. I will let you know.

    Thread Starter G-Olly

    (@g-olly)

    Nope for some reason I cannot seem to override these constants set by WC. Whenever I have WC enabled I get:

    constants – Defined Constants:

    [DONOTCACHEPAGE] => true
    [DONOTCACHEOBJECT] => true
    [DONOTCACHEDB] => true

    @ryan Cowles – To test whether cache is working I first do the timestamp test in the WPSC dashboard, this fails. I then browse to my pages in a separate (different) browser as a not logged in user – reload the page a few times – check the page source for any indication of caching with: Display comments at the end of every page enabled. With WC enabled I get no indication at all.

    Ryan, would you be able to take a look at the site? You will have a better understanding about the situation and maybe can suggest a workaround? If so, please can you let me know your email address and I will send you the URL and a login.

    Many thanks, Olly

    Thread Starter G-Olly

    (@g-olly)

    OK I have gone to the class-wc-cache-helper.php and changed the:

    /**
    * Set nocache constants and headers.
    *
    * @access private
    * @return void
    */
    private function nocache() {
    if ( ! defined( 'DONOTCACHEPAGE' ) )
    define( "DONOTCACHEPAGE", "true" );
    
    if ( ! defined( 'DONOTCACHEOBJECT' ) )
    define( "DONOTCACHEOBJECT", "true" );
    
    if ( ! defined( 'DONOTCACHEDB' ) )
    define( "DONOTCACHEDB", "true" );
    
    nocache_headers();
    }

    to

    /**
    * Set nocache constants and headers.
    *
    * @access private
    * @return void
    */
    private function nocache() {
    if ( ! defined( 'DONOTCACHEPAGE' ) )
    define( "DONOTCACHEPAGE", "false" );
    
    if ( ! defined( 'DONOTCACHEOBJECT' ) )
    define( "DONOTCACHEOBJECT", "false" );
    
    if ( ! defined( 'DONOTCACHEDB' ) )
    define( "DONOTCACHEDB", "false" );
    
    nocache_headers();
    }

    as I thought this might just be a test to see if this would allow the caching to work. Unfortunately not the cache is still not working. Hmmm….

    Thread Starter G-Olly

    (@g-olly)

    There is definitely a conflict between my WC and WPSC. As when WC is deactivated, WPSC works when in PHP mode – when WC is enabled WPSC does not. But even trying to override by changing the code above the result is the same. I am going round in circles here…

    Thread Starter G-Olly

    (@g-olly)

    Hooray, finally worked it out, will not work for those needing the no cache of cart etc. in Woocommerce but for my set-up this was the fix. I found the call of the Cache Helper within woocommerce.php and just simply commented it out.

    plugins/woocommerce/woocommerce.php on line 287:

    // Classes (used on all pages)
    		include_once( 'includes/class-wc-product-factory.php' );				// Product factory
    		include_once( 'includes/class-wc-countries.php' );						// Defines countries and states
    		include_once( 'includes/class-wc-integrations.php' );					// Loads integrations
    		/**include_once( 'includes/class-wc-cache-helper.php' );					// Cache Helper*/
    		include_once( 'includes/class-wc-https.php' );							// https Helper

    I am no developer so don’t know whether this is a good fix or not but it works for me at the moment. Obviously the next time WC needs updating I will have to reimplement this change, unless anyone can give me pointers to a more permanent solution?

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Obviously the next time WC needs updating I will have to reimplement this change, unless anyone can give me pointers to a more permanent solution?

    I recommend brining this up to WooCommerce. They shouldn’t be interfering with existing caches like this, and I imagine many of their users also have their own caches and are simply unaware of this.

    Rather than commenting it out every WooCommerce upgrade, ask WooCommerce to fix it so you don’t have to. πŸ˜‰

    Thread Starter G-Olly

    (@g-olly)

    Yeah I will, though weirdly enough in all my research trying to get this sorted, the only reference I found to people having problems with WooCommerce and caching were those having issues with the plugins caching the cart and other dynamic parts – nothing to do with the pages not getting cached at all. Strange, as it seems that with the class included all pages (not just the Woo ones) do not get cached, at least with my set-up this happened.

    When I tried to get Woos involvement before they just suggested I go with W3TC, which has been developed to work with WC. This plugin worked for a time but almost crashed my server with the amount of inodes it was creating so I had to uninstall it. I will ask them again but not sure of the reception I will receive…

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Nothing caching at all, don't understand!!’ is closed to new replies.