Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#42299 closed enhancement (fixed)

Change params on get_site_by_path

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

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 6 years ago.

Download all attachments as: .zip

Change History (8)

@spacedmonkey
6 years ago

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


6 years ago

#2 @spacedmonkey
6 years ago

  • Milestone changed from Awaiting Review to 5.0

#3 @spacedmonkey
6 years ago

  • Owner set to jeremyfelt
  • Status changed from new to assigned

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


6 years ago

#5 @SergeyBiryukov
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to 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.


6 years ago

#7 @flixos90
5 years ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.