Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#62588 new defect (bug)

fetch_feed caching broken in WP 6.7

Reported by: kaygee79's profile kaygee79 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.7
Component: Feeds Keywords: needs-testing-info
Focuses: performance Cc:

Description

This is a follow-up to #55604.

Feed caching appears to be broken after WP6.7 was updated to SimplePie 1.8.0. I believe the issue is with SimplePie as there is a fix merged (but not yet released): https://github.com/simplepie/simplepie/pull/883/files

Change History (4)

This ticket was mentioned in Slack in #core-test by oglekler. View the logs.


5 months ago

#2 @oglekler
5 months ago

  • Keywords needs-testing-info added

Hi @kaygee79 thank you for the report.

Can you, please, describe the symptoms of the broken caching and how to test that is now working anymore?

We need to reproduce the issue to work on the solution to fix it.

Thank you!

#3 @kaygee79
5 months ago

If I run the following code in WP 6.7.1

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

https://cdn-std.droplr.net/files/acc_1201575/RBlHC1
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:

https://cdn-std.droplr.net/files/acc_1201575/41veRP
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:

https://cdn-std.droplr.net/files/acc_1201575/BoS1dq
https://cdn-std.droplr.net/files/acc_1201575/TwfxpM

#4 @peterwilsoncc
5 months ago

  • Focuses performance added
  • Version changed from 6.7.1 to 6.7

Reviewing the upstream ticket SimplePie#830, it doesn't appear that the fix is intended to be included in a 1.8 minor release, it's currently on the 1.9.0 milestone and tracking issue.

It might be worth backporting the upstream fix prior to the release of 1.9.0, although that's risky as it may be missed as we update SimplePie 1.8.x versions.

Note: See TracTickets for help on using tickets.