CloudFlare cache options

Vote:
 

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 mysite.com/globalassets/digizuite/12345-my-title.pdf
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?

#254772
May 13, 2021 15:25
Vote:
 

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.

#254774
May 13, 2021 16:12
Vote:
 

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.

#254781
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.
Vote:
 

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.

#254932
May 17, 2021 6:44
Vote:
 

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: https://feedback.episerver.com/ideas/DXCS-I-254

#256661
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.