Support » Plugin: WP Super Cache » WP Super Cache Won't Cache Home Page

  • Resolved G P


    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:

Viewing 2 replies - 1 through 2 (of 2 total)
  • G P


    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/
    22:38:36 / No Super Cache file found for current URL: /usr/local/apache2/vhosts/
    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* **

    G P


    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:

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Super Cache Won't Cache Home Page’ is closed to new replies.