[wp-trac] [WordPress Trac] #45605: REST API: Avoid DB queries from generating sample permalink when possible
WordPress Trac
noreply at wordpress.org
Sat Jan 5 18:06:00 UTC 2019
#45605: REST API: Avoid DB queries from generating sample permalink when possible
--------------------------+---------------------
Reporter: dlh | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.1
Component: REST API | Version: 5.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+---------------------
Comment (by dlh):
Replying to [comment:4 RogerTheriault]:
> I came across this ticket while investigating performance issues
relating to many database requests from `wp_unique_post_slug()` in
situations where a published attachment had an unfortunately common title
such as '1' and a REST request was made that includes the embeds ( e.g.
`/wp-json/wp/v2/posts/1234567?_embed=true` )
>
> The patch doesn't seem to reduce those.
Correct, the patch currently addresses only cases where the `_fields`
parameter is passed. To address requests without `_fields` (like for
embeds), the request `context` would also need to be checked.
I'm happy to modify the patch to check `context` if there's a consensus
that this is an exceptional case making it OK to do so.
@TimothyBlynJacobs, can I ask what your impression is now, with some time
having passed?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45605#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list