WP Super Cache
[resolved] WP Super Cache Won't Cache Home Page (3 posts)

  1. G P
    Posted 1 year ago #

    I'm using the mod-rewrite cache mechanism. The site is really fast (except for the home page) with the SuperCache active and every other page is showing the "cached" tags in the bottom of the view source. The Home Page, however, doesn't seem to cache, and is relatively slow to load. The tags do not appear at the bottom of the home page code. Any idea where to start? Here is the website: http://www.wshg.net


  2. G P
    Posted 1 year ago #

    Tried PHP mode and it still doesn't create home page cache files. Also, the "test" button creates two home pages named 1.html and 2.html but neither of them have the cache tags in the bottom of the source code.

    Also, here is a sample of the logs at the occurance:

    22:38:36 / supercache dir: /usr/local/apache2/vhosts/wshg.net/htdocs/wp-content/cache/supercache/wshg.net/
    22:38:36 / No Super Cache file found for current URL: /usr/local/apache2/vhosts/wshg.net/htdocs/wp-content/cache/supercache/wshg.net/index.html
    22:38:37 / In WP Cache Phase 2
    22:38:37 / Setting up WordPress actions
    22:38:37 / Created output buffer
    22:38:37 / Output buffer callback
    22:38:37 / No closing html tag. Not caching.
    22:38:37 / wp_cache_shutdown_callback: collecting meta data.
    22:38:37 / Did not write meta file: wp-cache-e42df010bdb75c28dd799948793ea914.meta ** *1* **
  3. G P
    Posted 1 year ago #

    Ok after much Googling and research I finally figured it out. I wasn't using the output buffer correctly in my home page sliders. Here was my code:

    // display a trimmed subtitle if it exists.
    if (function_exists('the_subheading')) {
    the_subheading('', '');
    $output = ob_get_clean();
    $short_subtitle = mb_substr($output,0,50);
    if (strlen($short_subtitle) >0){
    print '<span class="subheading">' . $short_subtitle;
    if (strlen($short_subtitle) >49) { echo '...'; }
    print '</span>';

    I needed to just remove the "ob_end_flush();" from the end, as the ob_get_clean was enough. This code trims the length of the subheadlines provided by "SUbheading" plugin found here: http://wordpress.org/extend/plugins/subheading

    Hope this comes to good use by someone else using WordPress WP Super Cache and the ob_start() function.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic