#36767 closed defect (bug) (fixed)
oEmbed performance optimisation
Reported by: | bactisme | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 4.5.3 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Embeds | Keywords: | has-patch fixed-major |
Focuses: | performance | Cc: |
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)
#1
@
9 years ago
- Component changed from General to Embeds
- Owner set to swissspidy
- Status changed from new to assigned
- Version changed from trunk to 4.4
#4
@
9 years ago
- Keywords fixed-major added
- Milestone changed from 4.6 to 4.5.3
- Resolution fixed deleted
- Status changed from closed to reopened
#8
@
9 years ago
- Keywords has-patch added; fixed-major removed
- Resolution fixed deleted
- Status changed from closed to 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.
In 37708: