Cloudflare is a popular CDN that is used by many people using Infinityfree.
Cloudflare caches your webpages and serves the static pages to visitors instead of fetching the page from the origin server.
If you have set Cloudflare cache settings to “cache everything” then it is in your interest to isolate sitemap.xml from that rule so a new fresh version is served rather than an outdated one (cached).
To do this, go to dash.cloudflare.com and select your domain. Go to the
Page Rules tab which looks like this:
Click “Create Page Rule” and set
*yourdomain.tld/sitemap* for the URL (replace
yourdomain.tld with your domain).
For the “Pick a Setting” field, select
Cache Level, and set the “Cache Level” to
Finally go to the “Caching” tab and click “Purge Everything” under “Purge Cache”.
Now whenever you update your sitemap file cloudflare will serve it directly without caching.
im not experanced in page rules, but try
yourdomain.tld/*.xml and cache to bypass…?
That will also work, but will not cache all xml files
So as long as sitemap.xml is your only xml file, it will work
Also remember to put a
* in front of
*yourdomain.tld/*.xml or else it will not work on all the url variations (
I would ask you to edit and clarify a little more clearly
because CF by default does not cache XML files
Cloudflare caches XML responses only when using Cache Everything.
So in a lot of cases users would do something they don’t need.
the matter is further complicated by various cache plugins for WP which also know to keep a sitemap in the cache
There is no need for you to give me credit and it just distracts people from your tutorial
(thanks but be free to drop that text )
Simply write at the beginning something like:
If you have set Cloudflare cache settings to “cache everything”
then it is in your interest to isolate sitemap.xml from that rule
so a new fresh version is served rather than an outdated one (cached).
btw. one small typo
Thanks Again I edited the post