WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 7 days ago

Last modified 6 days ago

#42299 closed enhancement (fixed)

Change params on get_site_by_path

Reported by: spacedmonkey Owned by: jeremyfelt
Milestone: 5.0 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 4 months ago.

Download all attachments as: .zip

Change History (7)

@spacedmonkey
4 months ago

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


4 months ago

#2 @spacedmonkey
3 months ago

  • Milestone changed from Awaiting Review to 5.0

#3 @spacedmonkey
3 months 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.


3 months ago

#5 @SergeyBiryukov
7 days 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 days ago

Note: See TracTickets for help on using tickets.