Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/14/2016 02:06:10 AM (8 years ago)
Author:
boonebgorges
Message:

Activity: Invalidate query caches when a user's 'last_activity' is updated.

User 'last_activity' is stored in the activity table, but not updated
via the Activity API, so regular invalidation techniques do not work.

In addition, 'last_activity' is quite frequently updated, meaning that
the activity query cache becomes less valuable. To mitigate this, the
current changeset separates the cache for queries containing
'last_activity' from the cache for those that do not.

Fixes #7245.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-cache.php

    r11077 r11101  
    7676 */
    7777function bp_activity_reset_cache_incrementor() {
    78     return bp_core_reset_incrementor( 'bp_activity' );
     78    $without_last_activity = bp_core_reset_incrementor( 'bp_activity' );
     79    $with_last_activity    = bp_core_reset_incrementor( 'bp_activity_with_last_activity' );
     80    return $without_last_activity && $with_last_activity;
    7981}
    8082add_action( 'bp_activity_delete',    'bp_activity_reset_cache_incrementor' );
Note: See TracChangeset for help on using the changeset viewer.