[wp-trac] [WordPress Trac] #35096: Every option call results in a database query on multisite

WordPress Trac noreply at wordpress.org
Tue Dec 15 05:42:24 UTC 2015


#35096: Every option call results in a database query on multisite
--------------------------------+-----------------------------
 Reporter:  buley               |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  4.4
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 `get_option()` (among other functions) calls `wp_load_alloptions()`:
 https://core.trac.wordpress.org/browser/tags/4.4/src/wp-
 includes/option.php#L27

 `wp_load_alloptions()` is never cached on multisite:
 https://core.trac.wordpress.org/browser/tags/4.4/src/wp-
 includes/option.php#L174

 This combines to result in many dozens unnecessary calls to the database
 on multisite installs when using options, for example 1 database query per
 `get_avatar()`. options should be cached, or at the very least be
 filterable such that I can cache them myself.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35096>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list