• Resolved Rookie

    (@alriksson)


    Once we flush the cache from the plugin we flush the whole Cloudflare cache right? As static assets is not updated often it would be good to clear only html cache if possible? With the API token? The free KV?

    The plugin should clear on page update etc, but would be good if we have the option to clear all Cloudflare html cache only.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @alriksson,

    Once we flush the cache from the plugin we flush the whole Cloudflare cache right?

    – If you flush the whole cache then yes the whole cache will be flushed. If you update page/post then it will depend on what setting you have chosen for the Automatically purge the Cloudflare's cache when something changes on the website settings under the cache tab. If you selected Purge cache for related pages only then it will only purge that page and its related pages.

    As static assets is not updated often it would be good to clear only html cache if possible?

    – That is not possible. As to Cloudflare all files are the same be it HTML or static and there is no special way to clear only the HTML items while not clearing the static files. But when you select the Purge cache for related pages only I think it only purges that page HTML cache and in this case, we purge via URL and not the whole cache. But when you purge whole cache everything gets purged.

    The plugin should clear on page update etc,

    – It does based on the settings you have selected as explained above.

    Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    I’m closing this thread

    Thread Starter Rookie

    (@alriksson)

    @isaumya Thanks for your reply.

    If you update page/post then it will depend on what setting you have chosen for the Automatically purge the Cloudflare’s cache when something changes on the website.
    If you selected Purge cache for related pages only then it will only purge that page and its related pages.

    This is great but consider you can detect and scan the XML sitemap you should be able to just grab all URLs there and via the API use custom purge and purge all URLs which would clear the html cache in the edge only.

    Wouldn’t that be possible to integrate? Since the images and other static assets usually never change as frequent as the html and wouldn’t need a flush. And would reduce hit and response time on all assets in the edge and take time to rebuild due to flush of cache.

    That is not possible. As to Cloudflare all files are the same be it HTML or static and there is no special way to clear only the HTML items while not clearing the static files. But when you select the Purge cache for related pages only I think it only purges that page HTML cache and in this case, we purge via URL and not the whole cache. But when you purge whole cache everything gets purged.

    Suggested a solution above, if I remember it right you’re able to use custom clear cache via the api? Would it be possible to restrict it only to an absolute path to clear to begin with. As I use a custom subdomain for images which I would prefer to not clear once it’s not needed. Meaning only clear https://domain.com/* and NOT https://sub.domain.com/* https://*.domain.com/*

    But when you select the Purge cache for related pages only I think it only purges that page HTML cache and in this case, we purge via URL and not the whole cache

    Will make sure to use this feature as well.

    Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hi @alriksson

    I’m already working on a similar solution. Stay tuned and merry xmas 😉

    Thread Starter Rookie

    (@alriksson)

    @salvatorefresta Nice! 😉 Merry Christmas! 😀

    Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hello @alriksson ,
    the feature is available on version 4.3.9

    Happy new year!

    Thread Starter Rookie

    (@alriksson)

    @salvatorefresta Great will check it out!

    Happy new year!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Clear all Cloudflare HTML cache only’ is closed to new replies.