Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #13149

    I am trying to run WP Super Cache and the debugger returns the error that there’s no closing html tag (in the theme):

    12:00:13 /?mcsf_action=main_css&ver=3.3.2 Cookie detected: wordpress_logged_in_308bebe324915c5539ae36e056fe8e36

    12:00:13 /?mcsf_action=main_css&ver=3.3.2 In WP Cache Phase 2

    12:00:13 /?mcsf_action=main_css&ver=3.3.2 Setting up WordPress actions

    12:00:13 /?mcsf_action=main_css&ver=3.3.2 Supercache caching disabled. Only using wp-cache. Non empty GET request.

    12:00:13 /?mcsf_action=main_css&ver=3.3.2 Created output buffer

    12:00:14 /?mcsf_action=main_css&ver=3.3.2 Output buffer callback

    12:00:14 /?mcsf_action=main_css&ver=3.3.2 No closing html tag. Not caching.

    12:00:14 /?mcsf_action=main_css&ver=3.3.2 wp_cache_shutdown_callback: collecting meta data.

    12:00:14 /?mcsf_action=main_css&ver=3.3.2 Did not write meta file: wp-cache-8f19b82fe81906cc1c76e158c677f33e.meta ** *0* **

    The only information I can get from the plug-in developer is that I need to edit the ‘wp_cache_eof_tags’ in the plug-in file: wp-cache-phase2.php. This is what it started with:

    if ( !preg_match( apply_filters( ‘wp_cache_eof_tags’, ‘/(</html>|</rss>|</feed>|</urlset|<?xml)/i’ ), $buffer ) ) {

    $new_cache = false;

    if( false === strpos( $_SERVER[ 'REQUEST_URI' ], ‘robots.txt’ ) ) {

    if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) {

    wp_cache_debug( “No closing html tag. Not caching.”, 2 );

    $buffer .= “n<!– Page not cached by WP Super Cache. No closing HTML tag. Check your theme. –>n”;

    }

    } else {

    if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( “robots.txt detected. Not caching.”, 2 );

    }

    I changed the php code to this:

    if ( !preg_match( apply_filters( ‘wp_cache_eof_tags’, ‘/(</div>|</rss>|</feed>|</urlset|<?xml)/i’ ), $buffer ) ) {

    $new_cache = false;

    if( false === strpos( $_SERVER[ 'REQUEST_URI' ], ‘robots.txt’ ) ) {

    if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) {

    wp_cache_debug( “No closing html tag. Not caching.”, 2 );

    $buffer .= “n<!– Page not cached by WP Super Cache. No closing HTML tag. Check your theme. –>n”;

    }

    } else {

    if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( “robots.txt detected. Not caching.”, 2 );

    }

    }

    The source code shows that the pages are being cached.

    <!– Cached page generated by WP-Super-Cache on 2012-06-08 11:41:08 –> <!– Dynamic page generated in 3.111 seconds. –>

    But the plug in still returns an open tag error.

    13:43:38 /?mcsf_action=main_css&ver=3.3.2 Created output buffer

    13:43:39 /?mcsf_action=main_css&ver=3.3.2 Output buffer callback

    13:43:39 /?mcsf_action=main_css&ver=3.3.2 No closing html tag. Not caching.

    13:43:39 /?mcsf_action=main_css&ver=3.3.2 wp_cache_shutdown_callback: collecting meta data.

    13:43:39 /?mcsf_action=main_css&ver=3.3.2 Did not write meta file: wp-cache-6e6ae65ee14d23457d11181e8ed5af04.meta ** *0* **

    Have you got any pointers as to how to solve this? Thanks.

    #78009

    Hi hysteric,

    I’m going to flag this for the rest of the support team. Devin, Dude and Ismael may have some insight that I don’t.

    Regards,

    Mya

    #78010

    Hi!

    Did you try other plugins like W3TC? I use it on my websites and I didn’t encounter any errors yet.

    Regards,

    Peter

    #78011

    Yes we did and it broke our site…. When we actioned W3TC to work in advance mode it wrote new code into the ht access file which inhibited any ability to update or create new posts…. it took us 2 days to work out what it had done to screw everything up – I wouldn’t advise anyone to use that plugin…

    #78012

    Sorry to hear that. Personally I can’t state anything negative about W3TC though. I’ll ask Kriesi if he’s familiar with WP Super Cache and maybe he can help you. Maybe try to validate your website with the w3c validator. Sometimes small html coding errors can cause major issues with wordpress plugins or some clients/browsers.

    #78013

    I’m having the same issue. Any answers for this?

    #78014

    Hi,

    I am sorry, that plugin is not compatible with the theme since it monopolizes ob_start, which the theme uses as well. There are now so many different cache plugins including W3 Total Cache, which is perfect for shared hosting websites, or Batcache with APC that there is no longer a need to ‘marry’ a particular cache plugin.

    If you are serious about speed consider running wordpress of nginx with, php-fpm, apc and varnish using cloudflare for dns on a metered cloud virtual host. Monthly price may be 10$ more but the speed boost is significant.

    Thanks,

    Nick

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Cache Optimisation’ is closed to new replies.