[wp-trac] [WordPress Trac] #62111: The cache of the embed seems weird

WordPress Trac noreply at wordpress.org
Fri Aug 8 08:38:42 UTC 2025


#62111: The cache of the embed seems weird
--------------------------+------------------------------
 Reporter:  arthur791004  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by rahultank):

 * Attachment "62111-embed-cache-fix.patch" added.

 Confirmed bug in embed cache logic. The issue is on line 272 where `||`
 should be `&&`.    **Problem:**   cache_oembed() sets usecache=false to
 force refresh, but the OR condition still returns cached content if
 cached_recently=true.    **Solution:**   Change `if ( $this->usecache ||
 $cached_recently )` to `if ( $this->usecache && $cached_recently )`
 This ensures cache is only used when both caching is enabled AND content
 is fresh. When forcing refresh, usecache=false bypasses cache regardless
 of age.

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


More information about the wp-trac mailing list