Delete oEmbed caches on pre_post_update so cached meta is used
|Reported by:||nacin||Owned by:||nacin|
WP_Embed::delete_oembed_caches() is hooked into 'save_post', after which it calls get_post_meta() in a roundabout way. This results in an automatic update_meta_cache() call for a saved post, when it may not be otherwise needed for the rest of that pageload.
By moving oEmbed deletion to pre_post_update, we're able to use metadata that is more likely to already be in cache. If it is not already in cache but we do need metadata after, this could potentially add a query. But, I think the tradeoff is worth it.
Parent ticket: #22189. Saving navigation menus are slow.