[wp-trac] [WordPress Trac] #51117: Sitemap & XSL requests execute main query for home page.
WordPress Trac
noreply at wordpress.org
Wed Aug 26 20:05:05 UTC 2020
#51117: Sitemap & XSL requests execute main query for home page.
---------------------------+------------------------------
Reporter: peterwilsoncc | Owner: pbiron
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version: 5.5
Severity: normal | Resolution:
Keywords: | Focuses: performance
---------------------------+------------------------------
Changes (by pbiron):
* owner: (none) => pbiron
* status: new => accepted
Comment:
I've noticed this as well and thought "why is it bothering to run the main
query when the results of that aren't used?".
But I'd point out that sitemaps aren't the only "rewrite rule-only"
request that does this: `https://example.com/robots.txt` and
`https://example.com/feed` run the main query as well.
While looking at this, I was happy to find that the REST API does **not**
run the main query: it hooks into `parse_request` and short circuits the
process when handling REST requests.
I haven't looked in detail yet, but am pretty sure sitemaps, robots.txt
and feeds could do the same thing. I wonder whether it would be
beneficial to introduce a general mechanism that all such "rewrite rule-
only" requests could build on?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51117#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list