[buddypress-trac] [BuddyPress Trac] #7404: Caching for `xprofile_get_field_from_name()`

buddypress-trac noreply at wordpress.org
Wed Dec 21 16:46:35 UTC 2016


#7404: Caching for `xprofile_get_field_from_name()`
-----------------------------------+------------------
 Reporter:  boonebgorges           |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  2.8
Component:  Extended Profile       |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |
-----------------------------------+------------------
Changes (by boonebgorges):

 * keywords:   => has-patch 2nd-opinion


Comment:

 I chose to go with an incrementor cache, so that all field-by-name caches
 are invalidated whenever a field is updated. I went this route for the
 following reason. If you have a field 'Foo', it'll be cached with a key
 'Foo'. If you then change the name to 'Bar', you have to know that the
 previous name was 'Foo' in order to invalidate the cache. The way we do
 field updates - by directly setting the `name` property on
 `BP_XProfile_Field` objects - makes this difficult or impossible to do.

 Feedback on the approach would be appreciated. See [attachment:7404.diff]

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7404#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list