Try our conversational search powered by Generative AI!

CloudFlare cache options


We are using Episerver DXP.
We have a DAM product, Digizuite, that integrates with Episerver.
When we publish an asset to Episerver, the asset is stored in blob storage.
The Urls look like
I don't want this Url to change, so everyone, including Google will use this Url.

This Url will get cached in Cloudflare.
I realize I can specify cache expiration.
But, I feel like I have no option but to purge the entire Cloudflare cache if a user tells me they uploaded a new version of a file to the DAM and they don't see the new file.
I've asked Episerver support if Cloudflare offers a single Url purge and I was told no.

Are my only options to purge everything OR set the cache expiration to be very small, ~4 hours?

May 13, 2021 15:25

Hi Mike

You can set a relatively short cache expiration (for instance ~4 hours). Then when a cached file expires, Cloudflare will revalidate whether the file has changed (sending ETag or modification date to Episerver). If the file has not changed in Episerver, then Cloudflare will use the version it already has.

May 13, 2021 16:12

We have processes that import new Commerce data and their associated assets into Epi. The commerce data and assets should match. So until the cache expires, our assets are old/wrong. Another scenario is if a user fixes a legal document they are forced to wait for the cache to clear.

A great solution would be to have a Cloudflare API that would allow us to clear individual Urls.

May 13, 2021 19:27
Scott Reed - May 17, 2021 6:31
you won't get access currently to the cloudflare API as everything is gated off. A simple solution would be when syncing the media when it changes to import it under a different name (maybe add the version ticks on the end) this would create a unique cached asset.

If it is very important to have assets invalidated shortly, maybe even immediately, after updating them, consider turning off caching. Or just turn it way down (e.g. 30-60 minutes).

Cloudflare will still revalidate the assets against Episerver, using ETag or Last Modified Date. And if a given asset file has not changed, Episerver will tell Cloudflare just that and that's it.

May 17, 2021 6:44

Doesn't help right now, but as an FYI, the ability to clear a single URL from the CDN cache is on the 2021 roadmap:

Jun 15, 2021 22:38
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.