Make WordPress Core


Ignore:
Timestamp:
09/22/2012 03:55:02 PM (12 years ago)
Author:
nacin
Message:

Stop cleaning the cache of a post's children. Ancestors are no longer cached against the post object, which means this kind of walking is unnecessary. It is also prohibitively expensive with large hierarchies.

We need to remove post_ancestors non-persistent caching for this. get_post_ancestors() can simply rely on the caching of get_post() instead. Previously, it was a direct query, hence the extra layers of caching and clearing.

Child cache clearing stays in wp_delete_post() as children get a new parent.

fixes #11399.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/load.php

    r21715 r21952  
    411411    if ( function_exists( 'wp_cache_add_global_groups' ) ) {
    412412        wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );
    413         wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins', 'post_ancestors' ) );
     413        wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
    414414    }
    415415}
Note: See TracChangeset for help on using the changeset viewer.