[wp-trac] [WordPress Trac] #62588: fetch_feed caching broken in WP 6.7

WordPress Trac noreply at wordpress.org
Thu Nov 28 03:20:11 UTC 2024


#62588: fetch_feed caching broken in WP 6.7
--------------------------------+------------------------------
 Reporter:  kaygee79            |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Feeds               |     Version:  6.7.1
 Severity:  normal              |  Resolution:
 Keywords:  needs-testing-info  |     Focuses:
--------------------------------+------------------------------

Comment (by kaygee79):

 If I run the following code in WP 6.7.1

 {{{#!php
 <?php
 add_filter('wp_feed_cache_transient_lifetime', function() {
     return 600;
 });

 add_action('init', function () {
   $feed_url = 'https://news.un.org/feed/subscribe/en/news/all/rss.xml';
   $feed = fetch_feed($feed_url);
 });
 }}}

 I see an HTTP API request in Query monitor on every load, as well as the
 transient being updated:

 [[Image(https://cdn-std.droplr.net/files/acc_1201575/RBlHC1)]]
 [[Image(https://cdn-std.droplr.net/files/acc_1201575/kL98uc)]]

 When I run the same code in WP 6.6.2 I see the initial request:

 [[Image(https://cdn-std.droplr.net/files/acc_1201575/41veRP)]]
 [[Image(https://cdn-std.droplr.net/files/acc_1201575/VMIVB1)]]

 And as expected, I do not see any HTTP API requests on subsequent loads
 for 10 minutes:

 [[Image(https://cdn-std.droplr.net/files/acc_1201575/BoS1dq)]]
 [[Image(https://cdn-std.droplr.net/files/acc_1201575/TwfxpM)]]

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


More information about the wp-trac mailing list