#cloudflare
pnpm exec Ignores Your cd, and Wrangler Deployed the Wrong Worker
I ran `cd workers/hn-proxy && pnpm exec wrangler deploy` and overwrote my live site with a two-day-old build. The deploy reported success. Here is the measured reason: pnpm exec walks up to the nearest package.json, and wrangler walks up looking for a config.
Cloudflare Injects Two Scripts Into Your HTML. My CSP Blocked One.
beacon.min.js and the Bot Fight Mode inline script arrive by different routes — one per Pages project, one per zone. I measured eight hosts across two zones and found a hash-based CSP quietly blocking Cloudflare's own bot detection.
Cloudflare Workers _headers: Why Your Rules Aren't Applying
Matching rules don't override each other — they stack, and same-name headers get appended. That's how a route ends up with two CSP headers, and why the fix is a `!` line. Measured against wrangler dev and production.
CSP Nonce vs Hash on a Static Site: The Edge Workaround Stamps the Attacker's Script Too
The standard advice is to put a Worker in front of your static site and inject nonces with HTMLRewriter. I built it and measured what it does: it signs every inline script it finds, including the one you didn't write.
Choosing a CMS for Astro on Cloudflare: Git-Based, Headless, or None at All
Astro on Cloudflare Workers doesn't dictate a CMS — it dictates a build. How content collections, git-based CMSes, hosted headless platforms, and a DIY D1 setup each fit that constraint, and how to pick between them.
Cloudflare Workers Redirects: The _redirects File
No Worker code required — a plain-text _redirects file handles 301s on Workers static assets. Syntax, splats, limits, and the trailing-slash gotcha that bit me.
How to Schedule Blog Posts on a Static Astro Site
No server, no CMS, no paid service — schedule posts on a static Astro site with a pubDate filter and a daily GitHub Actions rebuild. Timezone gotcha included.
Cloudflare Pages vs Workers in 2026: Which One for a Static Site?
Pages isn't deprecated — it's frozen. A feature-by-feature comparison, what each one costs, what migrating actually involves, and the two things Pages still does better than Workers.
Query the GA4 Data API from a Cloudflare Worker (No Google SDK)
Google's auth library pulls in 23 packages and won't bundle for workerd. The part you actually need — an RS256 JWT signed with Web Crypto — is about forty lines, and the key never leaves the Worker.
A Strict CSP for Astro on Cloudflare Workers (No Nonce Required)
Static sites can't mint a nonce, so inline scripts need hashes. My inline script blocks grow with every post, but the policy needs exactly 3 hashes — and the reason why is the part most CSP guides get wrong.
Deploy an Astro Site to Cloudflare Workers (2026 Guide)
Cloudflare now points new projects at Workers, not Pages. The current way to deploy a static Astro site: static assets, a custom domain, zero server code.