Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/12/2019 05:49:08 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Engagements: update cache groups in User strategy.

This commit makes all cache groups the same, and adds an inline comment about zero value object IDs. It also fixes a performance issue with pre-2.6 non-upgraded databases causing FIND_IN_SET queries not to be retrieved from cache correctly.

See #3292. For 2.7, trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/engagements.php

    r7024 r7025  
    612612    private function get_cache_key( $meta_key = '', $object_id = 0 ) {
    613613
    614         // No negative numbers in cache keys
     614        // No negative numbers in cache keys (zero is weird, but not disallowed)
    615615        $object_id = absint( $object_id );
    616616
     
    664664        $cache_key = $this->get_cache_key( $meta_key, $object_id );
    665665
    666         return wp_cache_get( $cache_key, 'bbpress_posts' );
     666        return wp_cache_get( $cache_key, 'bbpress_engagements' );
    667667    }
    668668
     
    684684        $user_ids  = $this->parse_comma_list( $user_ids );
    685685
    686         return wp_cache_set( $cache_key, $user_ids, 'bbpress_users' );
     686        return wp_cache_set( $cache_key, $user_ids, 'bbpress_engagements' );
    687687    }
    688688
     
    703703        $cache_key = $this->get_cache_key( $meta_key, $object_id );
    704704
    705         return wp_cache_delete( $cache_key, 'bbpress_users' );
     705        return wp_cache_delete( $cache_key, 'bbpress_engagements' );
    706706    }
    707707
Note: See TracChangeset for help on using the changeset viewer.