DEVOPS

Purge only the Cloudflare URLs changed in a Vercel deploy

On a successful production deploy, diffs the deployed commit to find changed pages and assets, then issues a surgical Cloudflare purge of just those URLs instead of the whole zone.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerwebhook
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerVercel production deploy succeededVercelVercel
  • Actiongit diff changed files vs previous SHAShell
  • LogicMap changed paths to public URLs
  • ActionCloudflare purge-by-URL in batchesCloudflareCloudflare
  • OutputSlack summary of purged URLsSlack

What it does

Instead of nuking the entire edge cache on every release, this workflow inspects the commit behind a Vercel production deploy, maps changed files to their public URLs, and purges only those specific URLs from Cloudflare. Most cached traffic stays warm, so you keep cache hit rates high while still shipping fresh content.

When to use it

Reach for it on high-traffic sites where a full purge causes an origin-load spike or a noticeable latency cliff. It is built for teams that deploy frequently and cannot afford to cold-start their entire edge cache several times a day.

How it works

  1. 1A Vercel `deployment.succeeded` webhook fires for production.
  2. 2A shell step runs `git diff --name-only` against the previous deployed SHA to list changed files.
  3. 3A logic step maps file paths to public URLs and drops files that do not affect cached output.
  4. 4Cloudflare's purge-by-URL call clears just that URL batch (chunked to the API limit).
  5. 5A Slack note lists the exact URLs purged and the count.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect VercelDeploys, runtime logs, analytics.
  2. 2
    Connect ShellRun sandboxed commands inside the workspace.
  3. 3
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  4. 4
    Connect SlackChannels, DMs, threads, mentions.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.