Empty cache only for new content

Hi,

When we update content, like a post, we have to empty all cache to make the post visible on all (overview) pages.

Each time, emptying the cache for all overview pages is not doable.

How can we make sure that new content is available “straight away”, without emptying the cache?

I am looking forward to hearing from you.

KR Marty

Cloudflare doesn’t cache pages unless you’ve intentionally set this up. To to a selective purge, you would have to a Purge by URL for each of the affected pages:

https://api.cloudflare.com/#zone-purge-files-by-url

1 Like

Hi Sdayman,

Thank you for your reply. Yes, we are aware of this.

The question is:
Are there settings in Cloudflare that cache automatically empties on only pages where content/ code updates are detected?

So new content is “directly” available.
We have a blog, an de new post will appear on several pages on our website, so we don’t continually want to empty cache when a new post is available.

Sorry, I only saw that your concern was about emptying all cache.

It’s certainly possible if you have a script that checksums all pages, then purges anything that doesn’t match.

Ultimately, what you’re asking would require Cloudflare to hit the origin for every request. There’s no efficient way to handle this from Cloudflare’s end, which is why it’s better to handle it at the origin.

Thanks! Do you know somebody who has experience with writing such a script or can you point me in the right direction?

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