[wp-trac] [WordPress Trac] #41847: Add caching to WP_User_query

WordPress Trac noreply at wordpress.org
Sun Sep 10 14:03:29 UTC 2017


#41847: Add caching to WP_User_query
--------------------------+------------------------------
 Reporter:  spacedmonkey  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Users         |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+------------------------------

Comment (by spacedmonkey):

 First patch adds basic caching. It add cache invalidation for user meta,
 adding users to blogs and CRUD functions for users.

 This changes all queries to be ids, get the whole user object. Then for
 fields queries, just pick off the fields out of the WP_User object that
 you want.

 Other big change is to the `cache_users` function. This function is very
 similar to `_prime_<type>_cache` function. I have added new param to
 `cache_users` of `$update_meta_cache` to optionally prime user meta
 caches.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41847#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list