Make WordPress Core

Opened 23 months ago

Last modified 23 months ago

#56440 new defect (bug)

Embed blocks in widget areas caching in many posts

Reported by: eceleste's profile eceleste Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0.1
Component: Embeds Keywords: dev-feedback
Focuses: Cc:


When I am using blocks for my widget areas I can include an oEmbed easily enough. For example, I might include a video in a sidebar or footer widget area using the embed Gutenberg block. This is great!

Then I notice that every single post that a user visits which displays that widget area as part of its templates will get duplicated post_meta entries caching the embed. This quickly pollutes the post_meta table with hundreds of duplicate entries for the same embed on different posts.

These "_oembed_xxx" and "_oembed_time_xxx" entries all have the same identifier for the "xxx" since they all come from the same embed in the widget area. Shouldn't these entries be associated with the widget area instead of the post?

In fact, why are these oembed cache values stored in post_meta at all? Isn't this the kind of thing that deserves more universal storage in case the same embed is used on more than one page in any circumstance?

Change History (3)

#1 @eceleste
23 months ago

I wonder, since these oembed cached values are designed to time out, why are we not using transients to keep the cached oembed more universally?

Version 0, edited 23 months ago by eceleste (next)

This ticket was mentioned in Slack in #core-test by ironprogrammer. View the logs.

23 months ago

#3 @ironprogrammer
23 months ago

  • Keywords dev-feedback added

Thank you for your report, @eceleste!

Marked with dev-feedback for input from a component maintainer. This may require discussion as to why the caching works this way.

Note: See TracTickets for help on using tickets.