Question

Seeing server errors when using the API

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!


Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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.