Cloudflare APO and RSS feed caching

I’ve noticed that RSS feeds on WordPress sites using APO are always a cf-cache-status: MISS. Is this something APO is doing, or is Cloudflare simply refusing to cache the response because it is content-type: application/rss+xml?

Ideally I would like this to be cached by Cloudflare, and invalidated by APO when a new post is published on the WordPress server.

We explicitly bypass caching for RSS feed. Cloudflare for WordPress plugin doesn’t support RSS feed invalidation on new post.

Thanks for the quick reply!

I’m working on a site that appears to have something like 40,000 RSS subscribers across several feed reader sites (it’s difficult to get the exact count) but that RSS feed is getting slammed. I tried an experiment overnight setting the URL to cache for 1 hour via a Cloudflare page rule, and my cache Hit rate went from around 70% to over 90%.

I suppose my best solution at this point is to simply issue a manual cache purge for the feed URL each time a new post is published.

Actually, I just looked through the Cloudflare WordPress plugin’s source, and it does appear to support RSS feed invalidation. In Hooks.php lines 226-233 appear to add the RSS feed paths to the list of URLs to be purged.

Does that not happen on a new page post?

Does that not happen on a new page post?

Probably not

I suppose my best solution at this point is to simply issue a manual cache purge for the feed URL each time a new post is published.

I agree this is the safest route.

Looking at the code, it appears to happen every time a post is updated, published or unpublished.

If that doesn’t work, it looks like the plugin supports a custom WordPress filter to update the list of URLs that get cached automatically.

Couldn’t you just micro cache it with a short edge cache TTL like 15-60 minutes selectable by end user? Any caching is better than none especially for high traffic spikes to RSS feeds.

1 Like

This account is on a Pro plan, so 60 minutes is the minimum I can select for the edge cache. I have no idea what you mean about “selectable by end user” when the end user has no control over the edge cache.

Edit: Nevermind, I see you are referring to the APO behavior. I agree completely that it would be awesome if this was a feature. As it is I have to use up a page rule to make it happen.

Yeah but APO cache is a CF Worker so it can technically set a cache TTL lower than what you can set via page rules or edge cache TTL. So if CF wanted to it could do micro caching TTL within APO. Same way Tiered caching is a Enterprise feature but made it’s way into APO.

1 Like

After some testing I can confirm that the Cloudflare plugin for WordPress does actually clear the cache for the RSS feed as soon as a new post is published.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.