[wp-trac] [WordPress Trac] #14983: Get cache object by field

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 28 08:12:24 UTC 2010


#14983: Get cache object by field
-------------------------+--------------------------------------------------
 Reporter:  johnbillion  |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Performance  |     Version:                 
 Severity:  normal       |    Keywords:                 
-------------------------+--------------------------------------------------
 Functions such as `get_term_by()` don't check the object cache before
 performing their query. We should introduce a function for getting a cache
 object by its field/value pair to make these more efficient.

 I've written a simple function, `get_cache_object_by()`, which accepts
 `$field` and `$value` parameters in the same way `get_term_by()` does, and
 an optional `$group` parameter for the cache group.

 `get_term_by()` and other `get_*_by()` functions could check the cache
 with this function before performing their query.

 The function is compatible with external object cache plugins that use the
 `cache` member variable of the `$wp_object_cache` object, as they should.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14983>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list