WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
wp_cache_post_change($post_id) clears whole cache (4 posts)

  1. sjspain
    Member
    Posted 1 year ago #

    I have a page I want to remove from the cache at the start of a new day to ensure that the current day's info is always given to the visitor.

    I'm calling wp_cache_post_change($post_id) from a function that is scheduled via wp_cron. It seems a simple enough thing to do, but unfortunately it actually clears the whole cache.

    I do NOT have "Clear all cache files when a post or page is published or updated." checked. My settings are all the recommended ones and only the recommended ones.

    I'm on the latest version (1.2), though I had the same problem on 1.1

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    Enable the debug log, that may shed some light on the problem for you.

  3. sjspain
    Member
    Posted 1 year ago #

    I've created plenty of out put with the debugging. I've trued to follow it through in the pluggin source but I'm struggling to why it's deleting everything rather than just the page requested.
    Just after midnight the cron action kicks in. The page it's trying to remove (369) happens to be the front page. I've tried it with other pages and get exactly the same output.

    ...
    00:00:02 /blog/wp-cron.php?doing_wp_cron In WP Cache Phase 2
    00:00:02 /blog/wp-cron.php?doing_wp_cron Setting up WordPress actions
    00:00:02 /blog/wp-cron.php?doing_wp_cron Supercache caching disabled. Only using wp-cache. Non empty GET request.
    00:00:02 /blog/wp-cron.php?doing_wp_cron URI rejected. Not Caching
    00:00:02 /blog/wp-cron.php?doing_wp_cron get_current_url_supercache_dir: warning! site_url (http://www.hwmc.org.uk/blog) not found in permalink (http://www.hwmc.org.uk/).
    00:00:02 /blog/wp-cron.php?doing_wp_cron get_current_url_supercache_dir: Removing SERVER_NAME (www.hwmc.org.uk) and http:// from permalink (http://www.hwmc.org.uk/). Is the url right?
    00:00:02 /blog/wp-cron.php?doing_wp_cron supercache dir: /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/
    00:00:02 /blog/wp-cron.php?doing_wp_cron wp_cache_post_id_gc post_id: 369 http://www.hwmc.org.uk/ clearing cache in /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/.
    00:00:02 /blog/wp-cron.php?doing_wp_cron prune_super_cache: wp_cache_rebuild_or_delete( /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/who/index.html )
    00:00:02 /blog/wp-cron.php?doing_wp_cron rebuild_or_gc: rename to /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/who/index.html.needs-rebuild
    00:00:02 /blog/wp-cron.php?doing_wp_cron gc: could not delete /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/who as it's not empty: index.html.needs-rebuild
    00:00:02 /blog/wp-cron.php?doing_wp_cron prune_super_cache: wp_cache_rebuild_or_delete( /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/youth-group/index.html )
    00:00:02 /blog/wp-cron.php?doing_wp_cron rebuild_or_gc: rename to /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/youth-group/index.html.needs-rebuild
    00:00:02 /blog/wp-cron.php?doing_wp_cron gc: could not delete /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/youth-group as it's not empty: index.html.needs-rebuild
    ...

    It then goes on to append .needs-rebuild to the index.html to for every page in the cache.
    Having done that it continues to try and remove the front page from the cache. But it just continues on to delete every page it had just renamed with .needs rebuild.

    ...
    00:00:02 /blog/wp-cron.php?doing_wp_cron wp_cache_post_id_gc clearing cache in /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk//page/.
    00:00:02 /blog/wp-cron.php?doing_wp_cron wp_cache_post_id_gc clearing cache in /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk//page/.
    00:00:02 /blog/wp-cron.php?doing_wp_cron Post change: deleting cache files in /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/
    00:00:02 /blog/wp-cron.php?doing_wp_cron Post change: deleting page_on_front and page_for_posts pages.
    00:00:02 /blog/wp-cron.php?doing_wp_cron Post change: page_on_front 369
    00:00:02 /blog/wp-cron.php?doing_wp_cron get_current_url_supercache_dir: warning! site_url (http://www.hwmc.org.uk/blog) not found in permalink (http://www.hwmc.org.uk/).
    00:00:02 /blog/wp-cron.php?doing_wp_cron get_current_url_supercache_dir: Removing SERVER_NAME (www.hwmc.org.uk) and http:// from permalink (http://www.hwmc.org.uk/). Is the url right?
    00:00:02 /blog/wp-cron.php?doing_wp_cron supercache dir: /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/
    00:00:02 /blog/wp-cron.php?doing_wp_cron wp_cache_post_id_gc post_id: 369 http://www.hwmc.org.uk/ clearing cache in /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/.
    00:00:02 /blog/wp-cron.php?doing_wp_cron wp_cache_post_id_gc clearing cached index files in /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/.
    00:00:02 /blog/wp-cron.php?doing_wp_cron prune_super_cache: wp_cache_rebuild_or_delete( /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/who/index.html.needs-rebuild )
    00:00:02 /blog/wp-cron.php?doing_wp_cron rebuild_or_gc: deleted /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/who/index.html.needs-rebuild
    00:00:02 /blog/wp-cron.php?doing_wp_cron prune_super_cache: wp_cache_rebuild_or_delete( /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/youth-group/index.html.needs-rebuild )
    00:00:02 /blog/wp-cron.php?doing_wp_cron rebuild_or_gc: deleted /home/hax/public_html/blog/wp-content/cache/supercache/www.hwmc.org.uk/youth-group/index.html.needs-rebuild
    ...

    Any idea what's going on here. Can you give me a hint on where to look or something else to try that will help get to the bottom of this?

  4. Kaliostrozen
    Member
    Posted 1 year ago #

    sjspain, same thing happenning to me, did you ever find a solution?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic