Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 11 months ago

#63719 closed enhancement (fixed)

Use site transients for caching RSS Feeds

Reported by: peterwilsoncc Owned by: peterwilsoncc
Priority: normal Milestone: 6.9
Component: Feeds Version:
Severity: normal Keywords: has-patch has-dev-note
Cc: Focuses: multisite, performance

Description

WP_Feed_Cache_Transient currently uses standard transients for the storing of feed caches, ie get_transient() and set_transient().

The performance of feed caches on Multisite Installs of WordPress could be improved by switching this to using site transients, ie get_site_transient() and set_site_transient().

This will allow sub-sites of a Multisite install to share the cache of RSS feeds included on the site.

Change History (10)

This ticket was mentioned in ​PR #9281 on ​WordPress/wordpress-develop by ​@peterwilsoncc.


15 months ago
#1

  • Keywords has-patch added

Modifies the RSS cache to use site transients so the feeds are cached globally on multisite installs.

No tests until the ticket fixing feed caching is merged.

Trac ticket: https://core.trac.wordpress.org/ticket/63719

#2 @peterwilsoncc
15 months ago

#63718 was marked as a duplicate.

#3 @peterwilsoncc
15 months ago

  • Type defect (bug) → enhancement

#4 @peterwilsoncc
15 months ago

  • Milestone Awaiting Review → 6.9

With @spacedmonkey's approval on the ​linked pull request, I'm moving this to the 6.9 milestone.

Changes in the PR:

  • *_transient() calls replaced with *_site_transient()
  • Class level @since tag noting the use of the global cache on MS.

#5 follow-up: @rollybueno
15 months ago

Switching to site transients for WP_Feed_Cache_Transient makes a lot of sense, especially on multisite where every subsite currently ends up fetching the same feeds separately, so sharing the cache network-wide should definitely cut down on duplicate requests and improve performance.

Q> Would it be possible to add explicit unit tests to confirm the transient keys are stored in wp_options for single site and in wp_sitemeta for multisite?

#6 in reply to: ↑ 5 @peterwilsoncc
15 months ago

Replying to rollybueno:

Q> Would it be possible to add explicit unit tests to confirm the transient keys are stored in wp_options for single site and in wp_sitemeta for multisite?

I think that would be helpful in tests/phpunit/tests/option/siteTransient.php but I would do so against the Test tool and unit test improvements ticket (#63167 for WP 6.9) rather than this one. That will allow for a simpler and more focused test suite than using the transients created by fetching feeds. I can assist a review if you want to give it a go.

#7 @peterwilsoncc
15 months ago

  • Owner set to peterwilsoncc
  • Resolution → fixed
  • Status new → closed

In 60524:

Feeds: Cache RSS feeds in global transients.

Moves the caching of RSS feeds requested via fetch_feed() from single site transients (get|set|delete_transient()) to global transients (get|set|delete_site_transient()).

On multisite installs of WordPress, this replaces per site caching with the global multisite cache to allow a single cache to be shared between all sites. This reduces the amount of data stored in the database and improves performance of feeds when multiple sites are ingesting the same URL.

Props rollybueno, spacedmonkey, peterwilsoncc.
Fixes #63719.

This ticket was mentioned in ​Slack in #core by westonruter. ​View the logs.


12 months ago

#9 @desrosj
11 months ago

  • Keywords has-dev-note added

This improvement was detailed in the miscellaneous dev note for developer-focused changed: ​https://make.wordpress.org/core/2025/11/17/miscellaneous-developer-focused-changes-in-6-9/

Note: See TracTickets for help on using tickets.