[buddypress-trac] [BuddyPress Trac] #6638: XProfile fields should have cache support

buddypress-trac noreply at wordpress.org
Wed Sep 30 20:58:19 UTC 2015

#6638: XProfile fields should have cache support
 Reporter:  boonebgorges  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  2.4
Component:  API           |    Version:
 Severity:  normal        |   Keywords:
 We have some cache support for xprofile groups and for xprofile data, but
 there is currently pretty much nothing for the fields themselves. At a
 glance, it looks like the following should happen:

 * `xprofile_get_field()` should have a caching layer, so that calling
 `xprofile_get_field( $field_id )` many times only hits the database once.
 * `BP_XProfile_Groups::get()` currently does a `SELECT a bunch of fields
 FROM $bp->profile->table_name_fields`. Instead, we should split the query:
 one IDs only query, then update unprimed field caches, then fill in the
 field objects.
 * Invalidation as necessary.

 WordPress generally combines this sort of cache implementation with the
 process of mapping to proper objects: `$this->posts = array_map(
 'get_post', $posts )`. See #6358. Maybe this is a good place to start that
 process too.

 I think this ticket is a blocker for #5625.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6638>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list