Sitemap Caching Issue

Hi Support

This is my website’s post sitemap URL:

The problem is my post sitemap is not updating with new posts but it is correctly opening by entering this URL:

I have also created a page rule to stop caching my sitemap (Page rule URL: **.xml) but it is not working. I have set Cache level: Bypass

Please help me to get this issue fixed as soon as possible.

Waiting for your reply

Cloudflare is reporting cf-cache-status: DYNAMIC, meaning it’s bypassing the cache.

You are returning a 1h cache header, though. And it might be cached somewhere else, possibly in your server itself.


Sir, please guide me on how to fix it.

That’s not for me to fix. Your server…

Because it’s a different URL, which was not cached by your server before adding the posts… if you were to make a change, that URL will not reflect the change as well.

I am not sure it makes much sense, if you send a 1h caching header with the sitemap itself, to not actually cache it at the edge.

Do note that the URL might prevent caching of other files, as it’s covering all .xml files across all your subdomains.

This seems better, yeah.

I’m actually not sure if it would work, but it should:*sitemap*.xml

You could test it by adding a redirect to that rule or something and test all the 3 sitemap URLs that are standard.

Since you’re using WordPress and W3 Total Cache, make sure to configure and exclude (ignore) sitemap.xml related files from the Page Cache (if they aren’t already excluded by default).

Once a new post is published, xml files gets automatically purged at the origin host/server despite the 1h TTL set for the “object cache” in the W3TC options, to keep them at user’s web browser cache.

Check your “object cache TTL” if it’s set to 3600seconds, therefore if you’ve actually added xml sitemap files to “ignore” list. Double-check your .htaccess file if it’s properly modified by the WP plugin to apply the changes.

Furthermore, .xml files aren’t even cached by default at Cloudflare, therefore that’s not the Cloudflare issue at all.

As the docs say:

1 Like

Hi Fritex sir

Currently, I am using WP rocket. The code that you provided in the source article is not for WP rocket users as I have tried many times but it didn’t work.

Please guide me

Thank you for feedback.

How so? When I open your sitemap file I can see W3 Total Cache HTML commets :thinking:

I remember there were topics about WP Rocket + Cloudflare, therefore I suggest you to look up at the below articles in that terms just in case if you’d have some issue later - but you might not have or experience them. Some do, so I’d just like to share them below in case if happens in future:

Quick tip: Don’t use & mix-up more than 1 caching plugin for WordPress.

I don’t know why W3 Total Cache HTML comments are showing.

I am using WP rocket since I started my website.

Guide me sir?

you are right to an extent.

Care to expand this…?

Hello Matteo sir

My hosting provider is saying that. There is not any server problem from my end.

I am very confused now how to fix this issue? Please reply sir

Cloudflare isn’t caching it, it’s easy to check in the headers.

cf-cache-status: DYNAMIC means it’s not cached.

Cloudflare does not consider the asset eligible to cache and your Cloudflare settings do not explicitly instruct Cloudflare to cache the asset. Instead, the asset was requested from the origin web server. Use Page Rules to implement custom caching options.

Default Cache Behavior · Cloudflare Cache docs

The issue is most likely in the configuration of Wordpress, not the physical hardware, so go to the person responsible for it.


Sir by sitemap opens by entering this URL:

The cached sitemap is opening with the exact URL:

Please help me to solve this issue sir

  1. Disable each WordPress plugin.
  2. Ask your web hosting provider to flush a cache at your web hosting server.
  3. Purge Everything at Cloudflare → Caching → Configuration.

Ohk sir, Going to apply the same

Sir I have applied the same but the problem is still with my sitemap. Now, what to do?

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