[wp-trac] [WordPress Trac] #42251: Cache not found values for sites and network lookups by ID

WordPress Trac noreply at wordpress.org
Tue Oct 17 16:01:16 UTC 2017


#42251: Cache not found values for sites and network lookups by ID
-------------------------+-------------------------------------------------
 Reporter:  flixos90     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Networks     |    Version:
  and Sites              |   Keywords:  needs-patch needs-unit-tests dev-
 Severity:  normal       |  feedback
  Focuses:  multisite    |
-------------------------+-------------------------------------------------
 Currently when running `get_site( 12345 )` and no ID with that site
 exists, the result is not being cached. That means every subsequent lookup
 will still cause a DB query to be fired, which is unnecessary. The exact
 same applies to networks as well.

 Let's make sure falsy lookups are still cached under the ID checked.

 That also implies that upon creating a new site or network, its respective
 ID cache must be cleared to not longer receive the cached falsy result.
 This is already the case for sites anyway, for networks it's a bit more
 tricky because we don't have a real API for that. However, with a dev-note
 clarifying that, also given how "edge-case" multiple networks are, I think
 we're good making that change.

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


More information about the wp-trac mailing list