I am trying to clear a CDN cache via the API following this documentation (https://developers.digitalocean.com/documentation/v2/#purge-the-cache-for-an-existing-cdn-endpoint) and this code:
DELETE https://api.digitalocean.com/v2/cdn/endpoints/{{ endpoint }}/cache HTTP/1.1
Authorization: Bearer {{auth_token}}
Content-Type: application/json
Accept: application/json
{
"files": [
"uploads/staging/youth/en-gb/3_YOUTH_en-GB.mp3"
]
}
What I am seeing is that the request returns the expected 204 status and the cache is cleared when the cache is set, but when the cache is clear already (or at some other random times that I haven’t figured out yet) the request returns a 500 server error. From my testing, it looks like when this happens, the cache was not cleared.
Has anyone experienced this and / or can give some advice?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’ve just noticed this as well, but I’m not sure if it’s always done that or not. It would be nice for it to return 204 regardless if the file exists or not.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.