WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] Not writing another page to front page cache. (14 posts)

  1. sollers
    Member
    Posted 3 years ago #

    Hello,

    What does this debug error mean:
    Warning! Not writing another page to front page cache.

    Thank you!

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Is your homepage being cached? Is that error showing on the same url each time?

    There's a bug I can't track down that causes WP Super Cache to write the cache file for another page to the cache file for the homepage. It's completely random in my testing and happens once in a blue moon for me but I put this check in there to stop it happening.

    I don't know if it's the plugin, or something that WordPress does.

  3. sollers
    Member
    Posted 3 years ago #

    Hello,

    URL is not mentioned in debug email, just "Warning! Not writing another page to front page cache."

    Yes homepage is being cached, arround 200 files usually all together cached by your amazing plugin.

    Although Test outputs something strange.

    Fetching http://mywebsite.com/ to prime cache: OK
    Fetching first copy of http://mywebsite.com/: OK
    Fetching second copy of http://mywebsite.com/: OK
    The pages do not match! Timestamps differ or were not found!

    Thank you!

  4. Neil Mukerji
    Member
    Posted 3 years ago #

    I think I have a very similar situation here. When I run the tester I get this in the debug logs:

    14:19:18 /knowledge/wp-admin/options-general.php?page=wpsupercache&tab=tester Cookie detected: wordpress_logged_in_3cf3a5930aead04e1cd6db13648626b9
    14:19:18 /knowledge/wp-admin/options-general.php?page=wpsupercache&tab=tester In WP Cache Phase 2
    14:19:18 /knowledge/wp-admin/options-general.php?page=wpsupercache&tab=tester Setting up WordPress actions
    14:19:18 /knowledge/wp-admin/options-general.php?page=wpsupercache&tab=tester Not caching wp-admin requests.

    When I hit the front page from another browser (not logged in) I get:

    14:20:32 /knowledge/ supercache dir: [xxx]
    14:20:32 /knowledge/ No wp-cache file exists. Must generate a new one.
    14:20:33 /knowledge/ In WP Cache Phase 2
    14:20:33 /knowledge/ Setting up WordPress actions
    14:20:33 /knowledge/ Created output buffer
    14:20:33 /knowledge/ supercache dir: [xxx]
    14:20:33 /knowledge/ Output buffer callback
    14:20:33 /knowledge/ supercache dir: [xxx]
    14:20:33 /knowledge/ Anonymous user detected. Only creating Supercache file.
    14:20:33 /knowledge/ supercache dir:[xxx]
    14:20:33 /knowledge/ Gzipping buffer.
    14:20:33 /knowledge/ Writing non-gzipped buffer to supercache file.
    14:20:33 /knowledge/ Writing gzipped buffer to supercache file.
    14:20:33 /knowledge/ Warning! Not writing another page to front page cache.

    It looks to me as though all pages other than the front page are being cached okay. If I look in the supercache directory for all subdirectories I see files that make sense, such as index.html and index.html.gz, but in the root of the supercache directory I see a whole bunch of .tmp and .tmp.gz files.

    This is all a LAMP environment by the way. So it looks like Apache can write the temporary files, but needs to rename them and that fails. There's nothing in the audit or message logs relating to this.

    I've now traced the problem to line 538 of wp-cache-phase2.php - it appears that neither is_front_page() nor is_home() return true even when the home page is being called. My home page is not a list of posts, and it is not at the root of my virtualhost. It is however set correctly in WordPress address and Site address on the settings page.

    I've commented out the check on line 536 and the resulting actions on lines 537-539, and amended the elseif on 540 to an if, and it all seems well. I appreciate this may open us up to the bug discussed above - I'll report back if it does!

    I hope this level of detail helps.

  5. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks Neil, all that info is very useful and I'm surprised that is_home() and is_page() return false on your homepage! What do you have there? A static page?

    I think I'll have to make this check optional, while defaulting it to on. I'll have to log the failed requests somewhere to warn the admin if it happens too often.

  6. Neil Mukerji
    Member
    Posted 3 years ago #

    Hi there,

    The WP front page is http://www.signup-onlinemarketing.co.uk/knowledge/

    It's a WP 'Page' that uses a template (PHP file) that contains all of the content.

    Thanks for all the hard work on Supercache though!

    Neil.

  7. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    This is odd. I have a test site where WordPress is installed in a directory, and made the homepage a static page that uses a PHP file template. It works fine. Is there any chance you could debug the is_home() and is_front_page() functions?

    I'll still add the warning to the dashboard because this is a problem for some sites.

  8. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Can you check the value of "show_on_front" and "page_on_front" in your options table? I'm looking through the is_front_page() function and maybe something is up there.

    Also, does your template file use $query to generate it's list of posts? Overwriting that may cause problems.

  9. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Grab the development version from the download page (in about 15 minutes from now). You might be seeing problems with those functions because they're being called during PHP shutdown when objects have been destroyed.

  10. sollers
    Member
    Posted 3 years ago #

    Hello,

    I figured out why frontpage was not getting cached.

    Look at 2nd row...

    FRONTPAGE CACHE NOT WORKING

    <?
    query_posts('cat=300&showposts=1');
    if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <a>" rel="bookmark" title="<?php the_title(); ?>">XXL</a>
    <?php endwhile; ?>
    <?php endif; ?>

    FRONTPAGE CACHE WORKING

    <?
    query_posts('showposts=1');
    if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <a>" rel="bookmark" title="<?php the_title(); ?>">XXL</a>
    <?php endwhile; ?>
    <?php endif; ?>

    Any ideas how to bypass this and still pull posts from specific category?

    Thank you!

  11. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    So showing a different category makes is_home and is_front_page fail? That sucks.

    I'm going to add a checkbox so this check can be disabled.

  12. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Try the development version from here. I added an option (Extra homepage checks) to the Advanced Settings page to enable/disable this check.

  13. petercasier
    Member
    Posted 3 years ago #

    Donncha,

    Had the same issue as @sollars on a development site http://petercasier.be/dapablog

    Tried the development version, and issue was resolved.

    Thanks!

    Peter

  14. sollers
    Member
    Posted 3 years ago #

    Works.

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic