Success response from Purge Files by URL but files not removed

I am trying to purge specific files from my cache using Purge Files by URL and get a success = true response, but the files are not removed.

Should “http” or “https” URL be used in this request? I’m currently sending the full https URL e.g. “https://mydomain.com/page_to_purge.html”.

Does Purge Files by URL return true even if the files in the request do not exist?

Can anyone suggest trouble shooting ideas? A full cache purge is working.

Check the docs and see if any of the exclusions apply to your situation.

HTTP and HTTPS must be purged separately. My experience is that the Origin request header is often the culprit.

Thanks! I hadn’t found that page in the docs.

I’m serving my pages from S3. How do I check if I have an origin header that needs to be included in the Purge by URL request header?

The only other settings I’ve changed from the default is setting a Browser Cache TTL of 30 min and have a Page Rule that sets an Edge Cache TTL of 30 days. I don’t think these need to be included in the request header based on the example in the API docs?

The easiest way is usually your browsers dev tools feature, on the network tab. Find the request relating to the asset in question, and you will see a “Headers” panel (usually on the right hand side). You need to find the Request Headers. One of them might be named Origin, as in the image below.

Screenshot 2020-02-23 at 22.55.33

The TTLs will not change the purge request.

Are you clearing your browser cache when testing purge?

Update: I got it working. I need to include “https://domain.com/” and “https://domain.com/index.html” in the file list to purge index.html.