Make WordPress Core

Opened 16 months ago

Closed 8 months ago

#62588 closed defect (bug) (duplicate)

fetch_feed caching broken in WP 6.7

Reported by: kaygee79's profile kaygee79 Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.7
Component: Feeds Keywords: needs-test-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 (6)

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


16 months ago

#2 @oglekler
16 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
16 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
16 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.

#5 @wordpressdotorg
10 months ago

  • Keywords needs-test-info added; needs-testing-info removed

#6 @peterwilsoncc
8 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

My apologies, I forgot this ticket existed and opened #63717.

As the newer ticket has a pull request attached and a discussion about the approach, I'll close this one as a duplicate. I'll add a comment to ensure props are given appropriately.

Note: See TracTickets for help on using tickets.