Skip to:
Content

BuddyPress.org

Changeset 1238 for trunk/bp-groups.php


Ignore:
Timestamp:
03/19/2009 01:35:32 PM (17 years ago)
Author:
apeatling
Message:

Added basic object caching support ready for the first release. This will cut the number of database calls and load by 3x. Add define( 'WP_CACHE', true ); to you wp-config.php and drop object-cache.php into /wp-content/ to enable.

A good file based object cache is available here:
http://neosmart.net/dl.php?id=14

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r1227 r1238  
    706706            }
    707707
    708             do_action( 'groups_group_avatar_edited', $group_obj->id );
     708            do_action( 'groups_group_avatar_updated', $group_obj->id );
    709709
    710710            bp_core_redirect( site_url() . '/' . $bp->current_component . '/' . $bp->current_item . '/admin/group-avatar' );
     
    23132313
    23142314
     2315function groups_clear_group_object_cache( $group_id ) {
     2316    wp_cache_delete( 'groups_group_nouserdata_' . $group_id, 'bp' );
     2317    wp_cache_delete( 'groups_group_' . $group_id, 'bp' );
     2318    wp_cache_delete( 'newest_groups', 'bp' );
     2319    wp_cache_delete( 'active_groups', 'bp' );
     2320    wp_cache_delete( 'popular_groups', 'bp' );
     2321    wp_cache_delete( 'groups_random_groups', 'bp' );
     2322}
     2323
     2324// List actions to clear object caches on
     2325add_action( 'groups_group_deleted', 'groups_clear_group_object_cache' );
     2326add_action( 'groups_settings_updated', 'groups_clear_group_object_cache' );
     2327add_action( 'groups_details_updated', 'groups_clear_group_object_cache' );
     2328add_action( 'groups_group_avatar_updated', 'groups_clear_group_object_cache' );
     2329
    23152330// List actions to clear super cached pages on, if super cache is installed
    23162331add_action( 'groups_new_wire_post', 'bp_core_clear_cache' );
Note: See TracChangeset for help on using the changeset viewer.