Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/21/2014 05:51:10 PM (10 years ago)
Author:
boonebgorges
Message:

Overhaul the way that individual group objects are cached

The existing implementation was broken in a number of ways. Most critically,
user-specific data (like is_member) was being stored in the persistent object
cache without respect to user.

This refactor excludes the user-specific data from being cached along with the
group object. It also reworks the way that items are keyed in the cache, for
greater consistency with WordPress and the other BP components.

See #5407

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-cache.php

    r7844 r7956  
    6565 */
    6666function bp_groups_delete_group_cache( $group_id = 0 ) {
    67     wp_cache_delete( 'bp_groups_group_' . $group_id . '_load_users', 'bp' );
    68     wp_cache_delete( 'bp_groups_group_' . $group_id . '_noload_users', 'bp' );
     67    wp_cache_delete( $group_id, 'bp_groups' );
    6968}
    7069add_action( 'groups_delete_group',     'bp_groups_delete_group_cache' );
     
    7978 */
    8079function bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id ) {
    81     wp_cache_delete( 'bp_groups_group_' . $group_id . '_load_users', 'bp' );
    82     wp_cache_delete( 'bp_groups_group_' . $group_id . '_noload_users', 'bp' );
     80    wp_cache_delete( $group_id, 'bp_groups' );
    8381}
    8482add_action( 'updated_group_meta', 'bp_groups_delete_group_cache_on_metadata_change', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.