[wp-trac] [WordPress Trac] #37597: served oEmbed from cache even when expired

WordPress Trac noreply at wordpress.org
Fri Sep 1 14:19:41 UTC 2017


#37597: served oEmbed from cache even when expired
--------------------------+-----------------------
 Reporter:  zabatonni     |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Embeds        |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------
Changes (by QantumThemes):

 * keywords:   => needs-patch
 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 Replying to [comment:2 helen]:
 > That is the intention - an external HTTP request should not be fired on
 a pageview, so it will pull from cache (`$this->usecache`) no matter the
 age. The expiry is to determine whether to refresh an existing cache only
 when saving a post. Cached oEmbed responses are only refreshed on post
 save by default, which was the behavior before 4.0 as well.


 Hello everybody!
 I perfectly understand the intent of the code, but as matter of fact the
 oEmbed code is NOT refreshed on page save.

 For example, if you embed a YouTube video with some parameters (playlist
 for example) and Wp generates the oembed meta fields, then you edit the
 URL, also switch to code and to visual editor to try to refresh the
 oEmbeds, and then save, the parameters won't still be refreshed.

 In the same way, if you embed a video, normal way (putting the URL) and
 than remove that video and put another, even after saving, the oEmbed
 hidden fields will still contain the old video parameters, id, url, html
 embed code and so on.

 The only way to edit a previously created post with oembed fields, is to
 copy the content except the video URL, create a new post, and add the new
 video, then delete the old one.

 As you may understand, this is NOT normal, and the problem persist since
 years (and about 6 themes developed plus other 50+ websites created for
 private customers).

 For an average user, it is much more usual to copy-paste the wrong video
 or some useless/unwanted parameters, than to post a "hidden premiere of a
 hollywood movie" and "schedule a post for the big premiere" which may
 probably represent the 0.00001 of worldwide users.

 At the actual point, no method is provided to manually refresh metas, they
 don't refresh alone, no fix is provided, and the system is clearly not
 working as it should.


 You can notice that is true because there are lots of people with the same
 problem online, and the only working solution found till now is to
 manually regenerate metas.

 But this implies handling manually the WP globals, which should not be
 done by a theme or customer just to have embed working correctly
 (https://wordpress.stackexchange.com/questions/203537/how-can-i-clear-
 oembed-caches-for-youtube-on-posts-as-they-are-loaded).

 So it would be cool if Helen or anything else would take care of providing
 a real fix for this (and testing it before publishing and saying it's
 fixed).

 Thanks!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37597#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list