drkn.dev

Sep 18, 2026

Sample - Why this site ships so little JavaScript

Notes on building a portfolio with Astro on Cloudflare Workers, and the one place where a Worker does real work.

This is a placeholder post. Replace it with your own writing in src/content/blog/.

Every page on this site is prerendered HTML served from Cloudflare’s edge. Components are written in React, but Astro renders them on the server, so most pages ship no JavaScript at all. Only two islands hydrate, both on the home page: the ask box and the grid that follows the cursor.

The one dynamic route

/api/ask is the only on-demand route. It takes a visitor’s question, asks a System One model for a handful of typed judgments, and returns links to content that already exists on the site. Nothing is generated, so nothing can be made up.

export const prerender = false;

export const POST: APIRoute = async ({ request }) => {
	const { query } = await request.json();

	return Response.json(await route(query));
};

What I would do again

  • Start static and add a Worker only where a request truly needs one.
  • Keep content in typed files so pages and the endpoint read the same source.
  • astro
  • cloudflare
  • performance
All posts