Why is cloudflare not purging my assets?

I’m not sure what exactly im doing wrong here

I have a route for which I’ve enabled cache everything page rule. the route returns a standard JSON response. In order to prevent stale data from being sent , i either call the custom purge API or purge the route directly in the cloudflare UI.

The problem is that i still seem to be getting stale data despite the purge - here’s an example response i get from cloudflare AFTER i purge the route via the UI

  1. access-control-allow-credentials:

true

  1. access-control-allow-headers:

x-requested-with, Content-Type, frt-ref, kite-iframe

  1. access-control-allow-methods:

POST, PUT, GET, OPTIONS, DELETE, PATCH

  1. access-control-allow-origin:

https://web.xxx.xxx.com

  1. age:

2440

  1. cf-cache-status:

HIT

  1. cf-ray:

5af035321bc7e156-BOM

  1. cf-request-id:

03c9ff93500000e156bbabc200000001

  1. content-encoding:

gzip

  1. content-type:

text/html; charset=UTF-8

  1. date:

Tue, 07 Jul 2020 08:31:11 GMT

  1. expect-ct:

max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct

  1. server:

cloudflare

  1. status:

200

  1. strict-transport-security:

max-age=0

  1. vary:

Accept-Encoding

As you can see the age header is 2440 seconds which is clearly wrong since i purged the asset less then 30 seconds ago

I add the same URL when im trying to purge the cache by file

Figured it out -

my purge cache API call didnt include the origin headers - so cloudflare wasnt removing it

This topic was automatically closed after 30 days. New replies are no longer allowed.