Automatically purge file from CDN when the file is identified changed or removed
B
Binyamin
This seems like a bug or missing feature (I know it can be workarounded using DigitalOcean API or
doctl compute cdn flush $cdn_id --files $file
).The issue is when doing any file changes in DigitalOcean Spaces e.g. uploading an updated file using s3cmd - it is still stuck in CDN with the old file. Why DigitalOcean doesn't automatically purge file from CDN when the file is identified as changed or even removed? For example if https://cdn.mydomain.com/test.jpg doesn't exist, after I upload test.jpg to space https://cdn.mydomain.com/test.jpg would display it without requiring me to purge CDN cache. It is not consistent with case if test.jpg already exist and after I delete it or upload modified test.jpg, now https://cdn.mydomain.com/test.jpg still be stuck with the old file. DigitalOcean should automatically identify change and purge it from CDN cache.
J
Jeff Braunstein
open
J
Jeff Braunstein
closed
Hi Binyamin, thank you for your feedback!
The behavior you have described is the correct behavior for a CDN.
The object cached by a given CDN PoP will be updated when the object expires and/or the CDN does a refresh check (conditional HTTP GET).
From this page:
"You may want to use a shorter TTL for dynamic content and content that changes frequently. You may also want to set a longer edge cache TTL if you anticipate a large increase in traffic."
Here are instructions for setting the edge cache TTL:
-Jeff