Blog Architecture
Why I Moved My Blog to Astro and Cloudflare Workers
Notes on skipping heavy CMS servers and running a static Astro blog with Cloudflare D1, Turnstile comments, and zero monthly hosting bills.
On this page
Most blogging setups either force you to babysit a database server just to serve text, or lock your posts inside a proprietary SaaS dashboard. This site avoids both.
Every post compiles to plain HTML at build time with Astro and ships as static assets on Cloudflare Workers. Dynamic pieces stay small: comments read and write through a single Cloudflare D1 database, protected by Turnstile.
How publishing works
Posts live as plain Markdown files inside the repository. I can write locally in a text editor and git push, or open
Pages CMS in the browser when I want a form UI. Both paths commit the same frontmatter format back to GitHub.
title: 'Why I Moved My Blog to Astro and Cloudflare Workers'
pubDate: 2026-12-05
tags: [astro, cloudflare]
draft: false
Keeping the backend thin
Comments do not touch the main article HTML. When you open a post, the page loads straight from edge cache while the
comment box fetches /api/comments on demand:
- Visitors submit plain text with a Cloudflare Turnstile token and a hidden honeypot field.
- The Worker checks
siteverify, hashes the IP with a salt for a 10-minute rate limit, and writes to D1. - Cloudflare’s
send_emailbinding sends me a short alert when a new comment lands.
Bangla posts live alongside English ones under /bn whenever I upload a translation. No auto-translated filler.
Discussion
Comments
Loading comments...