• Resolved fkranjce1

    (@fkranjce1)


    Hi,

    I am using Cloudflare with cache all rules but with free plan there is not enough page rules to block Cloudflare from caching sitemap.

    Is it possible to add to Cloudflare extension of W3 Total cache to clear Sitemap on Cloudflare under “Flush CloudFlare on Post Modifications” option. Somehow to edit code or if that is good idea for others to be added in future version?

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @fkranjce1

    Thank you for reaching out and I am happy to assist you with this.
    Cloudflare shouldn’t cache any sitemap files (XML) unless you’ve manually set full site caching with a Page Rule.
    You should be able to dd a Page Rule with a Cache Level of Bypass for sitemap patter, for example, this should work for both Yoast and Rankmath:

    sitemap(_index)?\.xml(\.gz)?
    [a-z0-9_\-]*sitemap[a-z0-9_\-]*\.(xml|xsl|html)(\.gz)?
    ([a-z0-9_\-]*)?\.xml

    `
    Let me know if this helps!

    Thanks!

    Thread Starter fkranjce1

    (@fkranjce1)

    Hi Marko,

    I am using full site cache with Page Rules and that is why i’ve asked that question. With free Cloudflare account there is not enough free rules to add rule to bypass sitemap caching. It would be nice if W3 Total Cache also clear all sitemap files in Cloudflare when new post is published.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @fkranjce1

    Thank you for your feedback.
    The only way to exclude the sitemaps from being cached is by adding a Page Rule as provided in my previous post.
    Alternatively, you can purge the entire Cloudflare cache via the W3TC settings, in the top admin bar Performance>Purge modules>CloudFlare: All

    Thanks!

    Hi Mark,

    I am also facing the same issue. Please help me with that.

    I don’t know how to add a Page Rule with a Cache Level of Bypass for sitemap pattern.

    Please assist me how to do this and where to add this code:

    sitemap?\.xml?
    [a-z0-9_\-]*sitemap[a-z0-9_\-]*\xml|xsl)?
    ([az0-9_\-]*?)sitemap([a-z0-9_\-]*)?.xml

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sitemap and Cloudflare’ is closed to new replies.