Cloudflare Pages secrets require a redeploy to take effect, unlike Workers
A developer lost nearly a full day debugging 403 errors on paid download routes in a Cloudflare Pages project, only to discover the secrets were correctly set but never visible to production. Unlike Cloudflare Workers, Pages binds environment variables and secrets at deploy time rather than looking them up dynamically per request. This means running 'wrangler pages secret put' updates the project configuration but does not affect the currently-serving deployment until a new deploy is triggered. All standard checks — the secret list, the dashboard, and code review — appeared correct, masking the root cause entirely. The fix is straightforward: always run a deployment after setting a secret, and use the Cloudflare API to compare a deployment's bound variable snapshot against the current project secrets to confirm alignment.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in