Static performance at the edge
How static pages, minimal JavaScript, and controlled media reduce loading cost without weakening the editorial experience.
2 min read

Performance is not a final pass. In this blog, it shapes the architecture: Astro generates static HTML, CSS stays small, and JavaScript appears only where the page truly needs it.
HTML first
A normal article does not need to load an application in the browser. The content is rendered at build time, with links, table of contents, code blocks, and metadata already in place.
That improves perceived speed, reduces client-side failure points, and makes indexing easier.
Isolated JavaScript
JavaScript exists in small, explicit areas:
- theme switching;
- filters on the tags page;
- lazy comments;
- future demos only when a post declares them.
This boundary keeps optional features from becoming a global cost for every article.
Controlled media
Images live next to content and go through validation. In production, Cloudflare transformations can serve appropriate sizes and formats.
The goal is to keep the editorial feel without letting every image decide the page weight on its own.
Edge as a consequence
When the site is static, the edge can do its job well. Cloudflare Pages can serve generated HTML, optimized images, RSS, and sitemap files without an application server on every read.
Related posts
Comments
Comments load on demand to preserve the article's initial load.