Docs    YouTube

YouTube Feed Caching and Background Updates

Would you like to control how quickly new videos show up in your YouTube feed, or find out why a feed stopped updating?

YouTube Feed saves a copy of each feed on your site so that visitors don’t wait for YouTube to answer. A background task then refreshes that copy on a schedule.

This guide explains how that cache works and how to change how often feeds update. It also covers what Clear All Caches does and what to check when a feed stays out of date.

Before you get started, make sure YouTube Feed is installed and activated on your WordPress site.

Here is what we will cover:

How Does Feed Caching Work?

When a visitor opens a page with your feed, the plugin shows the copy it already saved. It does not ask YouTube for the videos each time. This keeps your page fast.

The saved copy is kept in your WordPress database. To keep it fresh, the plugin schedules a background task named sby_feed_update.

This is a WordPress scheduled task, also called a cron job. Each time it runs, it fetches the latest videos for every feed that is still in use and replaces the saved copy.

Note: The background task only runs when someone visits your site, because WordPress cron is triggered by page loads. On a site with little traffic, an update can arrive later than scheduled. If your host has turned WordPress cron off, see how to force the cron job to run.

Choosing How Often Feeds Update

To get started, we’ll open the Caching settings, where you set the update interval for all of your feeds in one place.

In your WordPress dashboard, go to YouTube Feed » Settings. Then, click the Feeds tab.

The YouTube Feed Settings page with an arrow on the Feeds tab

The first box on this tab is Caching. It has a dropdown for how often the feeds update.

The Caching box on the Feeds tab with an arrow on the update interval dropdown

The dropdown has these options.

  • Every 30 minutes
  • Every hour
  • Every 12 hours
  • Every 24 hours

A shorter interval shows new videos sooner. A longer interval makes fewer requests to YouTube, which uses less of your daily API quota.

If you pick Every 12 hours or Every 24 hours, 2 more dropdowns appear. You can then use them to choose the time of day the update runs, and whether that time is AM or PM.

The Caching box with Every 12 hours selected and an arrow on the time dropdown

When you have chosen your interval and time, click Save Changes at the top right of the page.

The top right of the Settings page with an arrow on the Save Changes button

Below the dropdowns, a green line shows when the next update is due. Right after you save, it can still show the old schedule, for example Next check: 01:03 AM (every hour). After you reload the page, the line matches your choice.

The Caching box after saving and reloading with Every 12 hours selected and the Next check line reading every 12 hours

For example, after you choose Every 12 hours at 1:00 AM, save, and reload, the line reads Next check: 01:00 AM (every 12 hours).

If you need a new video to show before the next update, you can clear the cache instead.

Clearing All Caches

If you want a feed to show new videos right now, clear the saved copies instead of waiting for the next update. On the same Feeds tab, click the Clear All Caches button next to the interval dropdown.

The Caching box with an arrow on the Clear All Caches button

When you click it, the plugin does these things.

  • Deletes the saved copy of every feed, so each feed is rebuilt from your current feed settings the next time it loads.
  • Clears the page cache of some caching plugins if they are active, such as WP Rocket, WP Fastest Cache, and Autoptimize. This way, visitors don’t keep seeing an old page.
  • Clears the scheduled sby_feed_update task. The plugin creates it again the next time a page on your site loads, which restarts the update schedule.

A message says Cache cleared successfully. The Next check line keeps showing the old time until you reload the page.

The Caching box after clicking Clear All Caches with the Cache cleared successfully message at the bottom left

Note: Clearing the cache does not refresh videos you already turned into WordPress posts. To learn how those work, see Converting YouTube Videos to a WordPress Custom Post Type.

Reading the Cron Cache Report

The plugin keeps a short report of its last background update.

To open it, go to YouTube Feed » Support, find the System Info section, and click Expand. The report stays hidden until you click it.

The System Info section on the Support page with an arrow on the Expand button

Then, scroll down to the Cron Cache Report heading. It shows the time of the last run, how many feeds it found, and when the scheduled tasks run next.

The Cron Cache Report on the Support page listing each feed with its Last Retrieve time and Did Update value

Each feed has its own entry with two lines. Last Retrieve is when the background update last saved a new copy of that feed, and Did Update says whether the update ran for it. A recent Last Retrieve time means the background update is working.

A date in 1970 means the background update has not saved a new copy of that feed yet. The next section explains why that can happen.

Why a Feed May Stop Updating

These are the most common reasons a feed does not update, even though the background task runs.

Feeds No Longer in Use

The background task skips a feed that no page has shown for 30 days. This stops the plugin from using your API quota on feeds nobody sees. The feed updates again the next time it is loaded on a page.

No API Key or Connected Account

The background update needs either a YouTube API key or a connected YouTube account. Without one, there is nothing to fetch with. See our guide to creating and using a YouTube API key.

A Feed That Fetches Nothing

When YouTube returns no videos, the plugin keeps the old saved copy instead of replacing it with an empty one. The Cron Cache Report can still say the feed updated, while the date for that feed does not change.

An Old Connected Account

Each saved copy keeps the feed details it was saved with. If you later change or remove the connected account the feed used, the background update can keep working from those old details and fetch nothing. Clearing the cache rebuilds each feed from your current settings, so the next background update can save it normally.

Your Daily API Quota

Requests made with an API key count against a daily YouTube API quota. When a busy site uses all of it, feeds stop updating until the quota resets. A longer update interval lowers how much quota you use.

For the exact message YouTube returns, see our guide to YouTube feed error messages.

Sometimes YouTube answers with a consent or CAPTCHA page instead of video data. In recent versions, the plugin records this as a connection error and tries again later. If the error keeps coming back, see the error message guide.

Caching Plugins

A caching plugin, host cache, or CDN can keep serving an old copy of your page even after the feed itself is up to date. If a feed looks old on your site but is fresh in the feed editor, clear that cache too. For help, see how caching plugins affect your feed.

That’s it! You now know how your feeds are cached and how to refresh them.

Next, learn what each YouTube feed error message means.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about YouTube feed caching.

Why doesn’t my feed show a video right after I post it on YouTube?

Your site shows the saved copy of the feed until the next background update. To see the new video sooner, click Clear All Caches on YouTube Feed » Settings, or choose a shorter update interval.

Does Clear All Caches delete my feeds?

No. It deletes the saved copies of your feeds, not the feeds themselves. Each feed is rebuilt from its current settings the next time it loads.

Which update interval should I choose?

If you post often and want new videos to show quickly, a shorter interval works best. If you post rarely or you are close to your daily API quota, a longer one is a better fit.

Where do I find the Cron Cache Report to send to support?

The Cron Cache Report is part of the System Info on the Support page. See how to get your System Info to copy it.

support

Couldn’t find your answer in the docs?

Contact Support