• Hi,
    I’ve noticed that if I put the home page in cache, editing one post, the home page (in Supercache) still contains the outdated version of the post.

    After editing the post, wp-super-cache invokes the code for rebuild several pages, including the home page, some categories and the single one.
    While the text of the post in the single (Supercache version) is updated properly, the Home page continues to have the outdated version.
    If I delete the home page file in Supercache thus forcing regeneration, all is updated correctly.

Viewing 6 replies - 16 through 21 (of 21 total)
  • That’s the cache rebuild feature. I have it enabled on my blog and it works here. It’s odd that it doesn’t work for you. Do your pages take a long time to regenerate? If they did, users would see the old version until it was recreated.

    Normally this is only for 2-3 seconds but perhaps something is happening on your site to either cause pages to take ages to create, or to kill the process that’s recreating the cache page. It renames the supercache rebuild file back to the index.html/index.html.gz but if the process dies (which is very unusual) before completing, it won’t update the supercache file.

    Thread Starter smarx80

    (@smarx80)

    <!– Dynamic page generated in 2.138 seconds. –>

    Usually, it takes from 0.7 to 2.8 seconds to be regenerated.

    Any suggestion to debug this function, specially if the process dies before creating the new index.html?

    Are there any seg faults in your error logs? You could add error_log() calls to wp_cache_phase2() in wp-cache-phase2.php – the cache rebuild code that renames the “rebuild” files back to index.hml/index.html.gz is there.

    The supercache file is written at the end of wp_cache_get_ob() – there’s a chance the function is bombing before the end. You should error_log() that function maybe before any return commands.

    Thread Starter smarx80

    (@smarx80)

    Hi donncha,

    I’m sorry, but I could not understand the cache reduild feature.

    At line 86 of wp-cache-phase2() you say:

    If the .needs-rebuild file was modified less than 30 seconds ago, rename it back to the .html file.

    Ok. So, if somebody visits the page in less than 30 seconds after the rename to .needs-rebuild, wp-super-cache will update the content very late, when the page expires. It’s correct?

    If someone visits the page within 30 seconds of the page being updated (and the rebuild file being created), the plugin will remove the .rebuild extension. That way other people who see that page will get a slightly outdated page for the few seconds it takes for the cached page to be regenerated by the current process.

    In wp_cache_get_ob() the cached page is generated and overwrites the files that were temporarily served to users for the few seconds the page took to be generated.

    Does that make sense?

    I had the same problem. Disabling cache rebuild solved it. I noticed in the cached files list a bunch with “.needs_rebuild” at the end. Apparently, they never got rebuilt.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘[Plugin: WP Super Cache] Outdated Home page rebuild’ is closed to new replies.