#36767 closed defect (bug) (fixed)
oEmbed performance optimisation
| Reported by: | bactisme | Owned by: | swissspidy |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5.3 |
| Component: | Embeds | Version: | 4.4 |
| Severity: | normal | Keywords: | has-patch fixed-major |
| Cc: | Focuses: | performance |
Description
If you add one of your own post as oembed, It will, at the post page (or feed) request, still trigger oembed discovery mechanism (calling the page, parsing content to find oembed link), making a request from the server on itself.
(wp-include/class-oembed.php get_provider/discover)
If you don't have page cache (I don't on /feed) and make a post like "weekly summary" using a lot of oembed, its seems to trigger lot of requests.
Since we know it's one of our url, could we just remove the overhead of making a external request?
Attachments (1)
Change History (17)
#4
@
10 years ago
- Keywords fixed-major added
- Milestone 4.6 → 4.5.3
- Resolution fixed
- Status closed → reopened
#8
@
10 years ago
- Keywords has-patch added; fixed-major removed
- Resolution fixed
- Status closed → reopened
This needs to be tweaked slightly.
url_to_postid will return 0 when none is found. Then we're passing get_oembed_response_data, which then uses get_post. When an empty value is passed to get_post, the post global is used.
This results in some embeds being returned as an embed of the post instead of the intended result.
Test plugin: https://gist.github.com/kraftbj/535c3cfd2df6402f5f0024d035b68a59
In a post, add [ted id=1969].
Expected: The ID is converted to an oEmbed of a TED video.
Actual: A self-embed of the post.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 37708: