[wp-trac] [WordPress Trac] #40490: Prime post cache in `wp_make_content_images_responsive()`

WordPress Trac noreply at wordpress.org
Thu Apr 20 03:18:21 UTC 2017


#40490: Prime post cache in `wp_make_content_images_responsive()`
-------------------------+-----------------------------
 Reporter:  dlh          |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Media        |    Version:  4.7
 Severity:  normal       |   Keywords:  has-patch
  Focuses:               |
-------------------------+-----------------------------
 [35412] updated `wp_make_content_images_responsive()` so that it "warmed
 the cache" with `update_meta_cache()` before calling `get_post_meta()`.

 [38296] replaced `get_post_meta()` with `wp_get_attachment_metadata()`,
 but because the latter function calls `get_post()`, it can still cause a
 database query for each attachment that isn't in the cache.

 The attached patch would have `wp_make_content_images_responsive()` use
 `_prime_post_caches()` again to avoid the individual queries.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40490>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list