Surge deployment, cache not purged

I am using to deploy our app, and CF to manage the DNS.

If I use the surge assigned subdomain (not using cf dns), the app is refreshed properly on redeploy.
But when I deploy to (configured in cf dns), the js files are always loaded from memory in the browser (Status Code: 200 (from memory cache)) (Chrome)

I added ‘cache-test’ as a CNAME record (Proxied) to our regular acceptance domain on CF. The DNS settings seem to work, because I do see the app in the browser, and a ‘hard reload’ causes the modified js files to load.

I am using this deploy script

set -o errexit

source ./.env-acceptance

echo '=> Deploying...'
./node_modules/.bin/surge dist --domain=${DEPLOY_DOMAIN}

echo '=> Purging Cloudflare cache...'
curl -X POST "${CLOUDFLARE_ZONE_ID}/purge_cache" \
-H "X-Auth-Key: ${CLOUDFLARE_API_KEY}" \
-H "Content-Type: application/json" \
--data '{"files":[""]}'

I have also tried with: --data '{"purge_everything":true}'

Also using the CF dashboard ‘Purge Cache’ -> ‘Custom Purge’ did not work.

I must be missing something.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.