WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 7 months ago

#14759 closed enhancement

Improve the way oEmbed deals with caching — at Version 2

Reported by: Viper007Bond Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.0.1
Component: Embeds Keywords: has-patch commit needs-docs
Focuses: Cc:

Description (last modified by Viper007Bond)

As Matt pointed to me today, caching oEmbed results to post meta is kinda lame.

I originally did this because I didn't want the HTML in old posts changing on it's own, say for example if the oEmbed provider got compromised. However I think that's extremely unlikely since we only whitelist major websites that can be trusted.

Perhaps instead we should use transients to cache this data. That way when embed HTML is updated, posts will eventually be updated too due to expiring caches. I'm thinking a cache time of a week would be good, but with some random +/- to make sure multiple caches don't all expire at once.

A good example of this is Vimeo. Anyone who embedded a Vimeo embed in their post before a few weeks ago got <object>-based embeds. However now Vimeo gives out <iframe> based ones. The only way currently to update the old embeds to the new HTML (without using a few lines of code) is to edit all of the posts and re-save them to trigger a cache update. That's painful.

Alternate suggestions welcome though.

Change History (2)

comment:1 @Viper007Bond5 years ago

  • Description modified (diff)

comment:2 @Viper007Bond5 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.