# Cloudflare Pages: deploy-hash URL is slow to propagate (404 for ~30s) **Date**: 2026-06-17 **Context**: home-studio deploy verification **Severity**: low (cosmetic — canonical URL works) **Cost**: ~2 min wasted checking the wrong URL ## The trap After triggering a deploy via the Cloudflare API (`POST /pages/projects//deployments`), I tested the `deploy.url` field in the response (e.g. `https://abc1234.home-studio.pages.dev/`) and got HTTP 404 for the first ~30 seconds. The canonical URL (`https://home-studio.pages.dev/`) returned 200 but had the OLD bundle hashes because it hadn't re-pointed to the new deploy yet. ## The fix: wait, then verify both ```bash # Trigger deploy DEPLOY=$(curl -sS -X POST "$CF_API/pages/projects/home-studio/deployments" \ -H "Authorization: Bearer $CF_TOKEN" \ -F "branch=main" -F "commit=$SHA") DEPLOY_ID=$(echo "$DEPLOY" | jq -r '.result.id') # Wait for propagation (~30s on Cloudflare Pages) sleep 30 # Verify the deploy-hash URL serves the new bundle curl -sS "https://${DEPLOY_ID:0:8}.home-studio.pages.dev/" -o /dev/null -w "HTTP %{http_code}\n" # Verify the canonical URL serves the new bundle (may take longer) curl -sS https://home-studio.pages.dev/ | grep -oE 'index-[A-Za-z0-9_-]+\.js' # Sanity-check the bundle has the new code curl -sS "https://${DEPLOY_ID:0:8}.home-studio.pages.dev/assets/.js" | grep -c "expected-feature-string" ``` ## Bonus gotcha The canonical URL serves the LATEST successful deployment, but Cloudflare's CDN edge caches aggressively. Even after the new deploy shows `status: success` in the API, the canonical URL may still return the old bundle for up to 60 seconds. If you really need to verify a deploy, **always check the deploy-hash URL**, not the canonical. ## Related - CLOUDFLARE_API_TOKEN is in env vars - API endpoint: `POST /accounts//pages/projects//deployments` - Use multipart form with `manifest=` (empty), `branch=`, `commit=` fields ## Reference - home-studio deploys: `33ae096d` (v0.1.2) → `e92c9b96` (v0.2.0) → `e43d86ca` (v0.3.0) → `c1784f5f` (v0.3.0 amended)