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

WordPress Trac noreply at wordpress.org
Wed Sep 25 09:04:36 UTC 2024


#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        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I found the cache of the embed seems weird.

 Referring to [https://github.com/WordPress/wordpress-
 develop/blob/7f4fd30dffdfe8d7d817c2cdb4ab98408f1c0add/src/wp-includes
 /class-wp-embed.php#L272], the cache won't be expired even if the value of
 `$cached_recently` is false because there is no place to set the
 `$this->usecache` to false except the `cache_oembed` function.

 {{{
 if ( $this->usecache || $cached_recently ) {
   ...
 }
 }}}

 The goal of the `cache_oembed ` function seems to reset all the cache to
 the latest value. However, when triggering the `cache_oembed` function, if
 the cache is not expired, the cache won't be force-updated.

 As a result, it seems to be correct if we change the condition from `||`
 to `&&`. Does it make sense?

-- 
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