• Hi

    Everytime I edit a post the entire cache is being deleted.

    “Clear all cache files when a post or page is published or updated.” is unchecked

    “Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated”. is also unchecked

    I am using PHP to serve cache files.

    Here is my debug log

    12:37:45 /wp-admin/post.php wp_cache_get_cookies_values: /^wp-postpass|^comment_author_|^wordpress_logged_in_b46a0253727ee14123eb7666773aee01/ Cookie detected: wordpress_logged_in_b46a0253727ee14123eb7666773aee01
    12:37:45 /wp-admin/post.php In WP Cache Phase 2
    12:37:45 /wp-admin/post.php Setting up WordPress actions
    12:37:45 /wp-admin/post.php Not caching wp-admin requests.
    12:37:45 /wp-admin/post.php wp_cache_post_edit: draft post, not deleting any cache files.
    12:37:45 /wp-admin/post.php wp_cache_post_edit: Clearing cache for post 2680 on post edit.
    12:37:45 /wp-admin/post.php supercache dir: /home/playboy/wp-content/cache/supercache/playboy.co.il/party/
    12:37:45 /wp-admin/post.php wp_cache_post_id_gc post_id: 2680 http://playboy.co.il/party/ clearing cache in /home/playboy/wp-content/cache/supercache/playboy.co.il/party/.
    12:37:45 /wp-admin/post.php wp_cache_post_id_gc clearing cache in /home/playboy/wp-content/cache/supercache/playboy.co.il/party//page/.
    12:37:45 /wp-admin/post.php wp_cache_post_id_gc clearing cache in /home/playboy/wp-content/cache/supercache/playboy.co.il//page/.
    12:37:45 /wp-admin/post.php Post change: deleting cache files in /home/playboy/wp-content/cache/supercache/playboy.co.il/
    12:37:45 /wp-admin/post.php prune_super_cache: wp_cache_rebuild_or_delete( /home/playboy/wp-content/cache/supercache/playboy.co.il/index-mobile.html )
    12:37:45 /wp-admin/post.php rebuild_or_gc: deleted /home/playboy/wp-content/cache/supercache/playboy.co.il/index-mobile.html
    12:37:45 /wp-admin/post.php prune_super_cache: wp_cache_rebuild_or_delete( /home/playboy/wp-content/cache/supercache/playboy.co.il/index-mobile.html.gz )
    12:37:45 /wp-admin/post.php rebuild_or_gc: deleted /home/playboy/wp-content/cache/supercache/playboy.co.il/index-mobile.html.gz
    12:37:45 /wp-admin/post.php Post change: deleting page_on_front and page_for_posts pages.
    12:37:45 /wp-admin/post.php Post change: page_on_front 375
    12:37:45 /wp-admin/post.php supercache dir: /home/playboy/wp-content/cache/supercache/playboy.co.il/
    12:37:45 /wp-admin/post.php wp_cache_post_id_gc post_id: 375 http://playboy.co.il/ clearing cache in /home/playboy/wp-content/cache/supercache/playboy.co.il/.
    12:37:45 /wp-admin/post.php wp_cache_post_id_gc clearing cached index files in /home/playboy/wp-content/cache/supercache/playboy.co.il/.
    12:37:45 /wp-admin/post.php prune_super_cache: wp_cache_rebuild_or_delete( /home/playboy/wp-content/cache/supercache/playboy.co.il/contact-us/index.html.gz.needs-rebuild )
    12:37:45 /wp-admin/post.php rebuild_or_gc: deleted /home/playboy/wp-content/cache/supercache/playboy.co.il/contact-us/index.html.gz.needs-rebuild
    12:37:45 /wp-admin/post.php prune_super_cache: wp_cache_rebuild_or_delete( /home/playboy/wp-content/cache/supercache/playboy.co.il/contact-us/index.html.needs-rebuild )
    12:37:45 /wp-admin/post.php rebuild_or_gc: deleted /home/playboy/wp-content/cache/supercache/playboy.co.il/contact-us/index.html.needs-rebuild
    12:37:45 /wp-admin/post.php prune_super_cache: wp_cache_rebuild_or_delete( /home/playboy/wp-content/cache/supercache/playboy.co.il/about-us/index.html.gz.needs-rebuild )

    All cached files are deleted and the debug ends with:

    12:37:45 /wp-admin/post.php wp_cache_post_id_gc clearing cache in /home/playboy/wp-content/cache/supercache/playboy.co.il//page/.
    12:37:45 /wp-admin/post.php wp_cache_post_id_gc clearing cache in /home/playboy/wp-content/cache/supercache/playboy.co.il//page/.
    12:37:45 /wp-admin/post.php Post change: deleting post cache files for playboy.co.il/feed/: /home/playboy/wp-content/cache/wp-cache-20853b28f1897924b5bd54a2cf546a6e.html
    12:37:45 /wp-admin/post.php wp_cache_post_edit: Already processed post 2680.
    12:37:46 /wp-admin/post.php wp_cache_post_change: Already processed post 2680.

    I hope you can help me solve my issue. Thanks very much.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • FWIW, I believe the problem is in wp-cache-phase2.php, line 1079:

    if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( "wp_cache_post_id_gc clearing cached index files in $dir.", 4 );
    		//prune_super_cache( $dir, true, true );//Comment out this line to prevent all cached files being deleted when a single post id updated

    I’ve commented out that line as indicated above and now only my edited page is deleted/rebuilt. All other cache files remain intact.

    I tried commenting out the whole section of code inside the else, and it appears to stop the clearing of the cache for me as well.

    I suspect this is just a band-aid, though. It seems to me that some of my settings are not being saved correctly.

    I don’t think the whole else block should be commented out, just that line (the other line in there deletes the single post’s cache).

    Thanks. I did notice that the cache only stays when I update a post now. When I change a page or even the slides for a slider plugin (I think it uses a custom post type), it still clears the cache. (Haven’t tested moving a comment to a new folder yet–another thing that cleared the cache.) Still big progress, though.

    That’s odd. I’ve tested it with pages, not posts, and when a single page is updated, only that one page is marked for rebuild or deleted–the rest of the cache remains intact.

    Glad it helped a bit at least.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cache deleted after every post edit.’ is closed to new replies.