Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#42299 closed enhancement (fixed)

Change params on get_site_by_path

Reported by: spacedmonkey Owned by: jeremyfelt
Priority: normal Milestone: 5.1
Component: Networks and Sites Version: 4.6
Severity: normal Keywords: has-patch
Cc: Focuses: multisite

Description

In get_site_by_path, it calls get_sites. In most cases in domain and path only have one elemeent in their arrays. To improve performance, changing it to domain instead of domain__in will increase likelyhood it will hit an existing cache.

Attachments (1)

42299.diff​ (727 bytes ) - added by spacedmonkey 9 years ago.

Download all attachments as: .zip

Change History (8)

@spacedmonkey
9 years ago

This ticket was mentioned in ​Slack in #core-multisite by spacedmonkey. ​View the logs.


9 years ago

#2 @spacedmonkey
9 years ago

  • Milestone Awaiting Review → 5.0

#3 @spacedmonkey
9 years ago

  • Owner set to jeremyfelt
  • Status new → assigned

This ticket was mentioned in ​Slack in #core-multisite by flixos90. ​View the logs.


9 years ago

#5 @SergeyBiryukov
9 years ago

  • Resolution → fixed
  • Status assigned → closed

In 42698:

Networks and Sites: In get_site_by_path(), use single domain and path parameters if there's only one item to look for.

This should increase the chances of WP_Site_Query::get_sites() hitting an existing cache.

Props spacedmonkey.
Fixes #42299.

This ticket was mentioned in ​Slack in #core-multisite by jjj. ​View the logs.


9 years ago

#7 @flixos90
8 years ago

  • Milestone 5.0 → 5.1
Note: See TracTickets for help on using tickets.